cmds

package
v0.0.0-...-4fcc4bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package cmds contains the commands for the CLI.

Each file in this package represents a command for the CLI.

The commands are defined using the cobra library.

The commands are registered with the root command using the AddCommands function. (similar to using a `routes.go` in a web application)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConfigDir

func CreateConfigDir(dirPath string) (string, error)

CreateConfigDir creates a new config directory and returns the path.

func NewCompletionCmd

func NewCompletionCmd(
	ctx context.Context,
	w io.Writer,
	r io.Reader,
) *cobra.Command

NewCompletionCmd returns the completion command

func NewLSPCmd

func NewLSPCmd(
	ctx context.Context,
	writer io.Writer,
	reader io.Reader,
	handle LSPHandler,
	db *data.Database[master.Queries],
) *cobra.Command

NewLSPCmd creates a new command for the lsp subcommand

func NewStaticCmd

func NewStaticCmd(_ context.Context) *cobra.Command

NewStaticCmd createa a new command for the static command.

func NewVersionCmd

func NewVersionCmd() *cobra.Command

NewVersionCmd returns the version command.

func NewVetCmd

func NewVetCmd(
	ctx context.Context,
	w io.Writer,
	r io.Reader,
) *cobra.Command

NewVetCmd returns the vet command which evaluates code for common errors or invalid selectors.

Similar to go vet, but for seltabl defined structs.

func TestFileString

func TestFileString(tmpl testfileTemplate) (string, error)

TestFileString returns a string for a test file.

Types

type LSPHandler

type LSPHandler func(
	ctx context.Context,
	cancel *context.CancelFunc,
	msg *rpc.BaseMessage,
	db *data.Database[master.Queries],
	documents *safe.Map[uri.URI, *parsers.GoFile],
	urls *safe.Map[uri.URI, []string],
) (rpc.MethodActor, error)

LSPHandler is a struct for the LSP server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL