Documentation ¶
Overview ¶
Package lsp implements LSP for gopls.
Index ¶
- func LastNonWsToken(n ast.Node, pos loc.Pos) []ast.Node
- func NewAllDefinitionSymbolsFromCurrentModule(syntax *ntt.ParseInfo) []interface{}
- func NewCommand(pos loc.Position, title string, command string, args ...interface{}) (protocol.CodeLens, error)
- func NewCompListItems(suite *ntt.Suite, pos loc.Pos, nodes []ast.Node, ownModName string) []protocol.CompletionItem
- type Server
- func (s *Server) CodeAction(context.Context, *protocol.CodeActionParams) ([]protocol.CodeAction, error)
- func (s *Server) CodeLens(ctx context.Context, params *protocol.CodeLensParams) ([]protocol.CodeLens, error)
- func (s *Server) ColorPresentation(context.Context, *protocol.ColorPresentationParams) ([]protocol.ColorPresentation, error)
- func (s *Server) Completion(ctx context.Context, params *protocol.CompletionParams) (*protocol.CompletionList, error)
- func (s *Server) Config(section string) interface{}
- func (s *Server) Declaration(context.Context, *protocol.DeclarationParams) (protocol.Declaration, error)
- func (s *Server) Definition(ctx context.Context, params *protocol.DefinitionParams) (protocol.Definition, error)
- func (s *Server) Diagnose(uris ...protocol.DocumentURI)
- func (s *Server) DidChange(ctx context.Context, params *protocol.DidChangeTextDocumentParams) error
- func (s *Server) DidChangeConfiguration(context.Context, *protocol.DidChangeConfigurationParams) error
- func (s *Server) DidChangeWatchedFiles(context.Context, *protocol.DidChangeWatchedFilesParams) error
- func (s *Server) DidChangeWorkspaceFolders(context.Context, *protocol.DidChangeWorkspaceFoldersParams) error
- func (s *Server) DidClose(ctx context.Context, params *protocol.DidCloseTextDocumentParams) error
- func (s *Server) DidOpen(ctx context.Context, params *protocol.DidOpenTextDocumentParams) error
- func (s *Server) DidSave(ctx context.Context, params *protocol.DidSaveTextDocumentParams) error
- func (s *Server) DocumentColor(context.Context, *protocol.DocumentColorParams) ([]protocol.ColorInformation, error)
- func (s *Server) DocumentHighlight(context.Context, *protocol.DocumentHighlightParams) ([]protocol.DocumentHighlight, error)
- func (s *Server) DocumentLink(ctx context.Context, params *protocol.DocumentLinkParams) ([]protocol.DocumentLink, error)
- func (s *Server) DocumentSymbol(ctx context.Context, params *protocol.DocumentSymbolParams) ([]interface{}, error)
- func (s *Server) ExecuteCommand(ctx context.Context, params *protocol.ExecuteCommandParams) (interface{}, error)
- func (s *Server) Exit(ctx context.Context) error
- func (s *Server) Fatal(ctx context.Context, msg string)
- func (s *Server) FoldingRange(context.Context, *protocol.FoldingRangeParams) ([]protocol.FoldingRange, error)
- func (s *Server) Formatting(context.Context, *protocol.DocumentFormattingParams) ([]protocol.TextEdit, error)
- func (s *Server) Hover(context.Context, *protocol.HoverParams) (*protocol.Hover, error)
- func (s *Server) Implementation(context.Context, *protocol.ImplementationParams) (protocol.Definition, error)
- func (s *Server) IncomingCalls(context.Context, *protocol.CallHierarchyIncomingCallsParams) ([]protocol.CallHierarchyIncomingCall, error)
- func (s *Server) Info(ctx context.Context, msg string)
- func (s *Server) Initialize(ctx context.Context, params *protocol.ParamInitialize) (*protocol.InitializeResult, error)
- func (s *Server) Initialized(ctx context.Context, params *protocol.InitializedParams) error
- func (s *Server) Log(ctx context.Context, msg string)
- func (s *Server) LogTrace(context.Context, *protocol.LogTraceParams) error
- func (s *Server) NonstandardRequest(ctx context.Context, method string, params interface{}) (interface{}, error)
- func (s *Server) OnTypeFormatting(context.Context, *protocol.DocumentOnTypeFormattingParams) ([]protocol.TextEdit, error)
- func (s *Server) OutgoingCalls(context.Context, *protocol.CallHierarchyOutgoingCallsParams) ([]protocol.CallHierarchyOutgoingCall, error)
- func (s *Server) Output(level log.Level, msg string) error
- func (s *Server) PrepareCallHierarchy(context.Context, *protocol.CallHierarchyPrepareParams) ([]protocol.CallHierarchyItem, error)
- func (s *Server) PrepareRename(context.Context, *protocol.PrepareRenameParams) (*protocol.Range, error)
- func (s *Server) RangeFormatting(context.Context, *protocol.DocumentRangeFormattingParams) ([]protocol.TextEdit, error)
- func (s *Server) References(ctx context.Context, params *protocol.ReferenceParams) ([]protocol.Location, error)
- func (s *Server) Rename(context.Context, *protocol.RenameParams) (*protocol.WorkspaceEdit, error)
- func (s *Server) Resolve(context.Context, *protocol.CompletionItem) (*protocol.CompletionItem, error)
- func (s *Server) ResolveCodeLens(context.Context, *protocol.CodeLens) (*protocol.CodeLens, error)
- func (s *Server) ResolveDocumentLink(context.Context, *protocol.DocumentLink) (*protocol.DocumentLink, error)
- func (s *Server) SelectionRange(context.Context, *protocol.SelectionRangeParams) ([]protocol.SelectionRange, error)
- func (s *Server) SemanticTokensFull(context.Context, *protocol.SemanticTokensParams) (*protocol.SemanticTokens, error)
- func (s *Server) SemanticTokensFullDelta(context.Context, *protocol.SemanticTokensDeltaParams) (interface{}, error)
- func (s *Server) SemanticTokensRange(context.Context, *protocol.SemanticTokensRangeParams) (*protocol.SemanticTokens, error)
- func (s *Server) Serve(ctx context.Context) error
- func (s *Server) SetTrace(ctx context.Context, params *protocol.SetTraceParams) error
- func (s *Server) Shutdown(ctx context.Context) error
- func (s *Server) SignatureHelp(context.Context, *protocol.SignatureHelpParams) (*protocol.SignatureHelp, error)
- func (s *Server) Symbol(context.Context, *protocol.WorkspaceSymbolParams) ([]protocol.SymbolInformation, error)
- func (s *Server) TypeDefinition(context.Context, *protocol.TypeDefinitionParams) (protocol.Definition, error)
- func (s *Server) WillSave(context.Context, *protocol.WillSaveTextDocumentParams) error
- func (s *Server) WillSaveWaitUntil(context.Context, *protocol.WillSaveTextDocumentParams) ([]protocol.TextEdit, error)
- func (s *Server) WorkDoneProgressCancel(context.Context, *protocol.WorkDoneProgressCancelParams) error
- type Status
- type Suites
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAllDefinitionSymbolsFromCurrentModule ¶ added in v0.8.0
Types ¶
type Server ¶
type Server struct { Suites // contains filtered or unexported fields }
Server implements the protocol.Server interface.
func (*Server) CodeAction ¶
func (s *Server) CodeAction(context.Context, *protocol.CodeActionParams) ([]protocol.CodeAction, error)
func (*Server) ColorPresentation ¶
func (s *Server) ColorPresentation(context.Context, *protocol.ColorPresentationParams) ([]protocol.ColorPresentation, error)
func (*Server) Completion ¶
func (s *Server) Completion(ctx context.Context, params *protocol.CompletionParams) (*protocol.CompletionList, error)
func (*Server) Declaration ¶
func (s *Server) Declaration(context.Context, *protocol.DeclarationParams) (protocol.Declaration, error)
func (*Server) Definition ¶
func (s *Server) Definition(ctx context.Context, params *protocol.DefinitionParams) (protocol.Definition, error)
func (*Server) Diagnose ¶
func (s *Server) Diagnose(uris ...protocol.DocumentURI)
Diagnose runs various checks over a ttcn3 test suite.
From LSP spec:
Diagnostics are "owned" by the server so it is the server's responsibility to clear them if necessary. If a language has a project system (for example C#) diagnostics are not cleared when a file closes. When a project is opened all diagnostics for all files are recomputed (or read from a cache). When a file changes it is the server’s responsibility to re-compute diagnostics and push them to the client. If the computed set is empty it has to push the empty array to clear former diagnostics. Newly pushed diagnostics always replace previously pushed diagnostics. There is no merging that happens on the client side.
func (*Server) DidChangeConfiguration ¶
func (*Server) DidChangeWatchedFiles ¶
func (*Server) DidChangeWorkspaceFolders ¶
func (*Server) DocumentColor ¶
func (s *Server) DocumentColor(context.Context, *protocol.DocumentColorParams) ([]protocol.ColorInformation, error)
func (*Server) DocumentHighlight ¶
func (s *Server) DocumentHighlight(context.Context, *protocol.DocumentHighlightParams) ([]protocol.DocumentHighlight, error)
func (*Server) DocumentLink ¶
func (s *Server) DocumentLink(ctx context.Context, params *protocol.DocumentLinkParams) ([]protocol.DocumentLink, error)
func (*Server) DocumentSymbol ¶
func (*Server) ExecuteCommand ¶
func (*Server) FoldingRange ¶
func (s *Server) FoldingRange(context.Context, *protocol.FoldingRangeParams) ([]protocol.FoldingRange, error)
func (*Server) Formatting ¶
func (*Server) Implementation ¶
func (s *Server) Implementation(context.Context, *protocol.ImplementationParams) (protocol.Definition, error)
func (*Server) IncomingCalls ¶
func (s *Server) IncomingCalls(context.Context, *protocol.CallHierarchyIncomingCallsParams) ([]protocol.CallHierarchyIncomingCall, error)
func (*Server) Initialize ¶
func (s *Server) Initialize(ctx context.Context, params *protocol.ParamInitialize) (*protocol.InitializeResult, error)
func (*Server) Initialized ¶
func (*Server) NonstandardRequest ¶
func (*Server) OnTypeFormatting ¶
func (*Server) OutgoingCalls ¶
func (s *Server) OutgoingCalls(context.Context, *protocol.CallHierarchyOutgoingCallsParams) ([]protocol.CallHierarchyOutgoingCall, error)
func (*Server) PrepareCallHierarchy ¶
func (s *Server) PrepareCallHierarchy(context.Context, *protocol.CallHierarchyPrepareParams) ([]protocol.CallHierarchyItem, error)
func (*Server) PrepareRename ¶
func (*Server) RangeFormatting ¶
func (*Server) References ¶
func (*Server) Rename ¶
func (s *Server) Rename(context.Context, *protocol.RenameParams) (*protocol.WorkspaceEdit, error)
func (*Server) Resolve ¶
func (s *Server) Resolve(context.Context, *protocol.CompletionItem) (*protocol.CompletionItem, error)
func (*Server) ResolveCodeLens ¶
func (*Server) ResolveDocumentLink ¶
func (s *Server) ResolveDocumentLink(context.Context, *protocol.DocumentLink) (*protocol.DocumentLink, error)
func (*Server) SelectionRange ¶
func (s *Server) SelectionRange(context.Context, *protocol.SelectionRangeParams) ([]protocol.SelectionRange, error)
func (*Server) SemanticTokensFull ¶
func (s *Server) SemanticTokensFull(context.Context, *protocol.SemanticTokensParams) (*protocol.SemanticTokens, error)
func (*Server) SemanticTokensFullDelta ¶
func (*Server) SemanticTokensRange ¶
func (s *Server) SemanticTokensRange(context.Context, *protocol.SemanticTokensRangeParams) (*protocol.SemanticTokens, error)
func (*Server) SignatureHelp ¶
func (s *Server) SignatureHelp(context.Context, *protocol.SignatureHelpParams) (*protocol.SignatureHelp, error)
func (*Server) Symbol ¶
func (s *Server) Symbol(context.Context, *protocol.WorkspaceSymbolParams) ([]protocol.SymbolInformation, error)
func (*Server) TypeDefinition ¶
func (s *Server) TypeDefinition(context.Context, *protocol.TypeDefinitionParams) (protocol.Definition, error)
func (*Server) WillSaveWaitUntil ¶
func (*Server) WorkDoneProgressCancel ¶
type Suites ¶ added in v0.7.0
type Suites struct {
// contains filtered or unexported fields
}
Suites implements the mapping between ttcn3 source files and multiple test suites.
The language server must be able to correctly handle multiple test suites in parallel. For example, if a user edits a file, which is imports from two independent test suites the language server must not throw a redeclaration-error.
How do we solve this problem? Virtually all lsp features initiated from a open file. For every didOpen-event we check if the opened file is owned by at least one test suite. If there's not, we load a new suite by using the file's directory and various other inputs as heuristic.
func (*Suites) AddSuite ¶ added in v0.9.1
AddSuite add a TTCN-3 test suite to the list of known suites. the list of know suites.
func (*Suites) FirstSuite ¶ added in v0.9.2
FirstSuite returns the first test suite owning the file or an error if not owning suite was found.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Invoke with //go:generate helper/helper -t Server -d protocol/tsserver.go -u lsp -o server_gen.go invoke in internal/lsp
|
Invoke with //go:generate helper/helper -t Server -d protocol/tsserver.go -u lsp -o server_gen.go invoke in internal/lsp |
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec.
|
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec. |
servertest
Package servertest provides utilities for running tests against a remote LSP server.
|
Package servertest provides utilities for running tests against a remote LSP server. |
Package protocol contains the structs that map directly to the wire format of the "Language Server Protocol".
|
Package protocol contains the structs that map directly to the wire format of the "Language Server Protocol". |