gotools/gopls/internal/cmd/cmd.go

type Application

type EditFlags

func (app *Application) verbose() bool {}

// New returns a new Application ready to run.
func New() *Application {}

// Name implements tool.Application returning the binary name.
func (app *Application) Name() string {}

// Usage implements tool.Application returning empty extra argument usage.
func (app *Application) Usage() string {}

// ShortHelp implements tool.Application returning the main binary help.
func (app *Application) ShortHelp() string {}

// DetailedHelp implements tool.Application returning the main binary help.
// This includes the short help for all the sub commands.
func (app *Application) DetailedHelp(f *flag.FlagSet) {}

// this is a slightly modified version of flag.PrintDefaults to give us control
func printFlagDefaults(s *flag.FlagSet) {}

// isZeroValue is copied from the flags package
func isZeroValue(f *flag.Flag, value string) bool {}

// Run takes the args after top level flag processing, and invokes the correct
// sub command as specified by the first argument.
// If no arguments are passed it will invoke the server sub command, as a
// temporary measure for compatibility.
func (app *Application) Run(ctx context.Context, args ...string) error {}

// Commands returns the set of commands supported by the gopls tool on the
// command line.
// The command is specified by the first non flag argument.
func (app *Application) Commands() []tool.Application {}

func (app *Application) mainCommands() []tool.Application {}

func (app *Application) internalCommands() []tool.Application {}

func (app *Application) featureCommands() []tool.Application {}

var internalMu

var internalConnections

// connect creates and initializes a new in-process gopls session.
func (app *Application) connect(ctx context.Context) (*connection, error) {}

func (c *connection) initialize(ctx context.Context, options func(*settings.Options)) error {}

type connection

type cmdClient

type cmdFile

func newClient(app *Application) *cmdClient {}

func newConnection(server protocol.Server, client *cmdClient) *connection {}

func (c *cmdClient) TextDocumentContentRefresh(context.Context, *protocol.TextDocumentContentRefreshParams) error {}

func (c *cmdClient) CodeLensRefresh(context.Context) error {}

func (c *cmdClient) FoldingRangeRefresh(context.Context) error {}

func (c *cmdClient) LogTrace(context.Context, *protocol.LogTraceParams) error {}

func (c *cmdClient) ShowMessage(ctx context.Context, p *protocol.ShowMessageParams) error {}

func (c *cmdClient) ShowMessageRequest(ctx context.Context, p *protocol.ShowMessageRequestParams) (*protocol.MessageActionItem, error) {}

func (c *cmdClient) LogMessage(ctx context.Context, p *protocol.LogMessageParams) error {}

func (c *cmdClient) Event(ctx context.Context, t *interface{}

func (c *cmdClient) RegisterCapability(ctx context.Context, p *protocol.RegistrationParams) error {}

func (c *cmdClient) UnregisterCapability(ctx context.Context, p *protocol.UnregistrationParams) error {}

func (c *cmdClient) WorkspaceFolders(ctx context.Context) ([]protocol.WorkspaceFolder, error) {}

func (c *cmdClient) Configuration(ctx context.Context, p *protocol.ParamConfiguration) ([]interface{}

func (c *cmdClient) ApplyEdit(ctx context.Context, p *protocol.ApplyWorkspaceEditParams) (*protocol.ApplyWorkspaceEditResult, error) {}

// applyWorkspaceEdit applies a complete WorkspaceEdit to the client's
// files, honoring the preferred edit mode specified by cli.app.editMode.
// (Used by rename and by ApplyEdit downcalls.)
//
// See also:
//   - changedFiles in ../test/marker/marker_test.go for the golden-file capturing variant
//   - applyWorkspaceEdit in ../test/integration/fake/editor.go for the Editor variant
func (cli *cmdClient) applyWorkspaceEdit(wsedit *protocol.WorkspaceEdit) error {}

// applyTextEdits applies a list of edits to the mapper file content,
// using the preferred edit mode. It is a no-op if there are no edits.
func applyTextEdits(mapper *protocol.Mapper, edits []protocol.TextEdit, flags *EditFlags) error {}

// updateFile performs a content update operation on the specified file.
// If the old content is nil, the operation creates the file.
// If the new content is nil, the operation deletes the file.
// The flags control whether the operation is written, or merely listed, diffed, or printed.
func updateFile(filename string, old, new []byte, edits []diff.Edit, flags *EditFlags) error {}

func (c *cmdClient) PublishDiagnostics(ctx context.Context, p *protocol.PublishDiagnosticsParams) error {}

func (c *cmdClient) Progress(_ context.Context, params *protocol.ProgressParams) error {}

func (c *cmdClient) ShowDocument(ctx context.Context, params *protocol.ShowDocumentParams) (*protocol.ShowDocumentResult, error) {}

func (c *cmdClient) WorkDoneProgressCreate(context.Context, *protocol.WorkDoneProgressCreateParams) error {}

func (c *cmdClient) DiagnosticRefresh(context.Context) error {}

func (c *cmdClient) InlayHintRefresh(context.Context) error {}

func (c *cmdClient) SemanticTokensRefresh(context.Context) error {}

func (c *cmdClient) InlineValueRefresh(context.Context) error {}

func (c *cmdClient) getFile(uri protocol.DocumentURI) *cmdFile {}

func (c *cmdClient) openFile(uri protocol.DocumentURI) *cmdFile {}

// TODO(adonovan): provide convenience helpers to:
// - map a (URI, protocol.Range) to a MappedRange;
// - parse a command-line argument to a MappedRange.
func (c *connection) openFile(ctx context.Context, uri protocol.DocumentURI) (*cmdFile, error) {}

func (c *connection) semanticTokens(ctx context.Context, p *protocol.SemanticTokensRangeParams) (*protocol.SemanticTokens, error) {}

func (c *connection) diagnoseFiles(ctx context.Context, files []protocol.DocumentURI) error {}

func (c *connection) terminate(ctx context.Context) {}

// Implement io.Closer.
func (c *cmdClient) Close() error {}

// locationSpan converts a protocol (UTF-16) Location to a (UTF-8) span.
// Precondition: the URIs of Location and Mapper match.
func (f *cmdFile) locationSpan(loc protocol.Location) (span, error) {}

// rangeSpan converts a protocol (UTF-16) range to a (UTF-8) span.
// The resulting span has valid Positions and Offsets.
func (f *cmdFile) rangeSpan(r protocol.Range) (span, error) {}

// offsetSpan converts a byte-offset interval to a (UTF-8) span.
// The resulting span contains line, column, and offset information.
func (f *cmdFile) offsetSpan(start, end int) (span, error) {}

// offsetPoint converts a byte offset to a span (UTF-8) point.
// The resulting point contains line, column, and offset information.
func offsetPoint(m *protocol.Mapper, offset int) (point, error) {}

// spanLocation converts a (UTF-8) span to a protocol (UTF-16) range.
// Precondition: the URIs of spanLocation and Mapper match.
func (f *cmdFile) spanLocation(s span) (protocol.Location, error) {}

// spanRange converts a (UTF-8) span to a protocol (UTF-16) range.
// Precondition: the URIs of span and Mapper match.
func (f *cmdFile) spanRange(s span) (protocol.Range, error) {}

// pointPosition converts a valid span (UTF-8) point to a protocol (UTF-16) position.
func pointPosition(m *protocol.Mapper, p point) (protocol.Position, error) {}

type fix

func (*fix) Name() string       {}

func (cmd *fix) Parent() string {}

func (*fix) Usage() string      {}

func (*fix) ShortHelp() string  {}

func (*fix) DetailedHelp(flags *flag.FlagSet) {}

func (*fix) Run(ctx context.Context, args ...string) error {}