Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeRawFileDescriptor(data []byte) (*descriptorpb.FileDescriptorProto, error)
- func DefaultEnclosingRangeVisitor(tracker *paths.AncestorTracker, paths *[]protopath.Values) func(ast.Node) bool
- func FastLookupGoModule(f io.Reader) (string, error)
- func FindRefactorActions(ctx context.Context, request *protocol.CodeActionParams, linkRes linker.Result, ...) []protocol.CodeAction
- func FindSuffixMatchedPath(target, source string) (string, bool)
- func GoIdent(desc protoreflect.Descriptor) string
- func IsWellKnownPath(path string) bool
- func NewSelectRangeCommand(params SelectRangeParams) *protocol.Command
- func RefactorUndeclaredName(ctx context.Context, cache *Cache, uri protocol.DocumentURI, name string, ...) []protocol.CodeAction
- type Analyzer
- type Cache
- func (s *Cache) ChangedText(ctx context.Context, uri protocol.VersionedTextDocumentIdentifier, ...) ([]byte, error)
- func (c *Cache) Compile(protos []string, after ...func())
- func (c *Cache) ComputeCodeLens(uri protocol.DocumentURI) ([]protocol.CodeLens, error)
- func (c *Cache) ComputeDocumentLinks(doc protocol.TextDocumentIdentifier) ([]protocol.DocumentLink, error)
- func (c *Cache) ComputeHover(params protocol.TextDocumentPositionParams) (*protocol.Hover, error)
- func (c *Cache) ComputeInlayHints(doc protocol.TextDocumentIdentifier, rng protocol.Range) ([]protocol.InlayHint, error)
- func (c *Cache) ComputeSemanticTokens(doc protocol.TextDocumentIdentifier) ([]uint32, error)
- func (c *Cache) ComputeSemanticTokensRange(doc protocol.TextDocumentIdentifier, rng protocol.Range) ([]uint32, error)
- func (c *Cache) DidChangeConfiguration(ctx context.Context, settings Settings) error
- func (c *Cache) DidModifyFiles(ctx context.Context, modifications []file.Modification)
- func (c *Cache) DocumentSymbolsForFile(uri protocol.DocumentURI) ([]protocol.DocumentSymbol, error)
- func (c *Cache) FindAllDescriptorsByPrefix(ctx context.Context, prefix string, ...) WorkspaceDescriptors
- func (c *Cache) FindAllDescriptorsByQualifiedPrefix(ctx context.Context, prefix string, ...) WorkspaceDescriptors
- func (c *Cache) FindDefinitionForTypeDescriptor(desc protoreflect.Descriptor) (protocol.Location, error)
- func (c *Cache) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error)
- func (c *Cache) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error)
- func (c *Cache) FindExtensionByNumber(message protoreflect.FullName, field protowire.Number) (protoreflect.ExtensionType, error)
- func (c *Cache) FindExtensionsByMessage(message protoreflect.FullName) []protoreflect.ExtensionDescriptor
- func (c *Cache) FindFileByURI(uri protocol.DocumentURI) (protoreflect.FileDescriptor, error)
- func (c *Cache) FindGeneratedDefinition(ctx context.Context, params protocol.TextDocumentPositionParams) ([]protocol.Location, error)
- func (c *Cache) FindImportPathsByPrefix(ctx context.Context, prefix string) map[protocol.DocumentURI]string
- func (c *Cache) FindMessageByName(name protoreflect.FullName) (protoreflect.MessageType, error)
- func (c *Cache) FindMessageByURL(url string) (protoreflect.MessageType, error)
- func (c *Cache) FindPackageNameRefs(name protoreflect.FullName, prefixMatch bool) []protocol.Location
- func (c *Cache) FindParseResultByPath(path string) (parser.Result, error)
- func (c *Cache) FindParseResultByURI(uri protocol.DocumentURI) (parser.Result, error)
- func (c *Cache) FindPragmasByPath(path protocompile.ResolvedPath) (Pragmas, bool)
- func (c *Cache) FindReferenceLocationsForTypeDescriptor(desc protoreflect.Descriptor) ([]protocol.Location, error)
- func (c *Cache) FindReferences(ctx context.Context, params protocol.TextDocumentPositionParams, ...) ([]protocol.Location, error)
- func (c *Cache) FindReferencesForTypeDescriptor(desc protoreflect.Descriptor) ([]ast.NodeReference, error)
- func (c *Cache) FindResultByPath(path string) (linker.Result, error)
- func (c *Cache) FindResultByURI(uri protocol.DocumentURI) (linker.Result, error)
- func (c *Cache) FindResultOrPartialResultByPath(path string) (linker.Result, error)
- func (c *Cache) FindResultOrPartialResultByURI(uri protocol.DocumentURI) (linker.Result, error)
- func (c *Cache) FindTypeDescriptorAtLocation(params protocol.TextDocumentPositionParams) (protoreflect.Descriptor, protocol.Range, error)
- func (c *Cache) FormatDocument(doc protocol.TextDocumentIdentifier, options protocol.FormattingOptions, ...) ([]protocol.TextEdit, error)
- func (c *Cache) GetCodeActions(ctx context.Context, params *protocol.CodeActionParams) ([]protocol.CodeAction, error)
- func (c *Cache) GetCompletions(params *protocol.CompletionParams) (result *protocol.CompletionList, err error)
- func (r *Cache) GetMapper(uri protocol.DocumentURI) (*protocol.Mapper, error)
- func (c *Cache) GetSyntheticFileContents(ctx context.Context, uri protocol.DocumentURI) (string, error)
- func (c *Cache) LatestDocumentContentsWellFormed(uri protocol.DocumentURI, strict bool) (bool, error)
- func (c *Cache) LoadFiles(files []string)
- func (c *Cache) PrepareRename(in protocol.TextDocumentPositionParams) (*protocol.PrepareRenameResult, error)
- func (c *Cache) QueryWorkspaceSymbols(ctx context.Context, query string) []protocol.SymbolInformation
- func (c *Cache) RangeAllDescriptors(ctx context.Context, fn func(protoreflect.Descriptor) bool) error
- func (c *Cache) Rename(params *protocol.RenameParams) (*protocol.WorkspaceEdit, error)
- func (c *Cache) StreamWorkspaceDiagnostics(ctx context.Context, ch chan<- protocol.WorkspaceFullDocumentDiagnosticReport)
- func (c *Cache) TracksURI(uri protocol.DocumentURI) bool
- func (c *Cache) TryFindPackageReferences(params protocol.TextDocumentPositionParams) []protocol.Location
- func (c *Cache) WaitDocumentVersion(ctx context.Context, uri protocol.DocumentURI, version int32) error
- func (c *Cache) XGetAllDiagnostics() (map[protocol.DocumentURI][]protocol.Diagnostic, error)
- func (c *Cache) XGetAllMessages() []protoreflect.MessageDescriptor
- func (c *Cache) XGetLinkerResults() []linker.Result
- func (c *Cache) XGetMapper(uri protocol.DocumentURI) (*protocol.Mapper, error)
- func (c *Cache) XGetResolver() linker.Resolver
- func (c *Cache) XGetURIPathMappings() PathMappings
- func (c *Cache) XListWorkspaceLocalURIs() []protocol.DocumentURI
- type CacheOption
- type CacheOptions
- type CodeAction
- type Compiler
- type DiagnosticData
- type DiagnosticEvent
- type DiagnosticHandler
- func (dr *DiagnosticHandler) ClearDiagnosticsForPath(path string)
- func (dr *DiagnosticHandler) Flush()
- func (dr *DiagnosticHandler) FullDiagnosticSnapshot() map[string][]*ProtoDiagnostic
- func (dr *DiagnosticHandler) GetDiagnosticsForPath(path string, prevResultId ...string) ([]*ProtoDiagnostic, string, bool)
- func (dr *DiagnosticHandler) HandleError(err reporter.ErrorWithPos) error
- func (dr *DiagnosticHandler) HandleWarning(err reporter.ErrorWithPos)
- func (dr *DiagnosticHandler) Stream(ctx context.Context, callback ListenerFunc)
- type DiagnosticList
- func (dl *DiagnosticList) Add(d *ProtoDiagnostic)
- func (dl *DiagnosticList) Clear() []*ProtoDiagnostic
- func (dl *DiagnosticList) DeleteRelated(related RelatedInformation)
- func (dl *DiagnosticList) Flush() ([]*ProtoDiagnostic, string, bool)
- func (dl *DiagnosticList) Get(prevResultId ...string) (diagnostics []*ProtoDiagnostic, resultId string, unchanged bool)
- type DocumentASTRequest
- type GenerateCodeRequest
- type GenerateWorkspaceRequest
- type GeneratedDefinitionParams
- type GoLanguageDriver
- func (s *GoLanguageDriver) FindGeneratedFiles(uri protocol.DocumentURI, fileOpts *descriptorpb.FileOptions, ...) ([]ParsedGoFile, error)
- func (s *GoLanguageDriver) HasGoModule() bool
- func (s *GoLanguageDriver) ImplicitGoPackagePath(filename string) (string, error)
- func (s *GoLanguageDriver) ImportFromGoModule(importName string) (GoModuleImportResults, error)
- func (s *GoLanguageDriver) RefreshModules()
- func (s *GoLanguageDriver) SynthesizeFromGoSource(importName string, res GoModuleImportResults) (desc *descriptorpb.FileDescriptorProto, _err error)
- type GoModuleImportResults
- type ImportSource
- type InlayHintsSettings
- type ListenerFunc
- type ParsedGoFile
- type PathMappings
- type Pragmas
- type PreambleInfo
- type ProtoDiagnostic
- type RefreshModulesRequest
- type ReindexWorkspacesRequest
- type RelatedInformation
- type Resolver
- func (r *Resolver) CheckIncompleteDescriptors(results linker.Files) []string
- func (r *Resolver) FindFileByPath(path protocompile.UnresolvedPath, whence protocompile.ImportContext) (protocompile.SearchResult, error)
- func (r *Resolver) FindGeneratedFiles(uri protocol.DocumentURI, fd protoreflect.FileDescriptor) ([]ParsedGoFile, error)
- func (r *Resolver) IsRealWorkspaceLocalFile(uri protocol.DocumentURI) bool
- func (r *Resolver) LookupGoModule(filename string, f io.Reader) (string, error)
- func (r *Resolver) OpenFileFromDisk(ctx context.Context, uri protocol.DocumentURI) (file.Handle, error)
- func (r *Resolver) PathToURI(path string) (protocol.DocumentURI, error)
- func (r *Resolver) PreloadWellKnownPaths()
- func (r *Resolver) SyntheticFileContents(uri protocol.DocumentURI) (string, error)
- func (r *Resolver) SyntheticFiles() []protocol.DocumentURI
- func (r *Resolver) URIToPath(uri protocol.DocumentURI) (string, error)
- func (r *Resolver) UpdateURIPathMappings(modifications []file.Modification)
- type SelectRangeParams
- type Server
- func (s *Server) CacheForURI(uri protocol.DocumentURI) (*Cache, error)
- func (s *Server) CacheForWorkspace(workspace protocol.WorkspaceFolder) (*Cache, error)
- func (s *Server) CodeAction(ctx context.Context, params *protocol.CodeActionParams) ([]protocol.CodeAction, error)
- func (s *Server) CodeLens(ctx context.Context, params *protocol.CodeLensParams) (result []protocol.CodeLens, err error)
- func (s *Server) CodeLensRefresh(ctx context.Context) (err error)
- func (s *Server) CodeLensResolve(ctx context.Context, params *protocol.CodeLens) (result *protocol.CodeLens, err error)
- func (s *Server) ColorPresentation(ctx context.Context, params *protocol.ColorPresentationParams) (result []protocol.ColorPresentation, err error)
- func (s *Server) Completion(ctx context.Context, params *protocol.CompletionParams) (result *protocol.CompletionList, err error)
- func (s *Server) CompletionResolve(ctx context.Context, params *protocol.CompletionItem) (result *protocol.CompletionItem, err error)
- func (*Server) Declaration(context.Context, *protocol.DeclarationParams) (*protocol.Or_textDocument_declaration, error)
- func (s *Server) Definition(ctx context.Context, params *protocol.DefinitionParams) (result []protocol.Location, err error)
- func (s *Server) Diagnostic(ctx context.Context, params *protocol.DocumentDiagnosticParams) (*protocol.Or_DocumentDiagnosticReport, error)
- func (*Server) DiagnosticRefresh(context.Context) error
- func (s *Server) DiagnosticWorkspace(ctx context.Context, params *protocol.WorkspaceDiagnosticParams) (*protocol.WorkspaceDiagnosticReport, error)
- func (s *Server) DidChange(ctx context.Context, params *protocol.DidChangeTextDocumentParams) (err error)
- func (s *Server) DidChangeConfiguration(ctx context.Context, params *protocol.DidChangeConfigurationParams) error
- func (*Server) DidChangeNotebookDocument(context.Context, *protocol.DidChangeNotebookDocumentParams) error
- func (s *Server) DidChangeWatchedFiles(ctx context.Context, params *protocol.DidChangeWatchedFilesParams) error
- func (s *Server) DidChangeWorkspaceFolders(ctx context.Context, params *protocol.DidChangeWorkspaceFoldersParams) error
- func (s *Server) DidClose(ctx context.Context, params *protocol.DidCloseTextDocumentParams) (err error)
- func (*Server) DidCloseNotebookDocument(context.Context, *protocol.DidCloseNotebookDocumentParams) error
- func (s *Server) DidCreateFiles(ctx context.Context, params *protocol.CreateFilesParams) (err error)
- func (s *Server) DidDeleteFiles(ctx context.Context, params *protocol.DeleteFilesParams) (err error)
- func (s *Server) DidOpen(ctx context.Context, params *protocol.DidOpenTextDocumentParams) (err error)
- func (*Server) DidOpenNotebookDocument(context.Context, *protocol.DidOpenNotebookDocumentParams) error
- func (s *Server) DidRenameFiles(ctx context.Context, params *protocol.RenameFilesParams) (err error)
- func (s *Server) DidSave(ctx context.Context, params *protocol.DidSaveTextDocumentParams) (err error)
- func (*Server) DidSaveNotebookDocument(context.Context, *protocol.DidSaveNotebookDocumentParams) error
- func (*Server) DocumentColor(context.Context, *protocol.DocumentColorParams) ([]protocol.ColorInformation, error)
- func (*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) (result []interface{}, err error)
- func (s *Server) ExecuteCommand(ctx context.Context, params *protocol.ExecuteCommandParams) (any, error)
- func (s *Server) Exit(ctx context.Context) error
- func (*Server) FoldingRange(context.Context, *protocol.FoldingRangeParams) ([]protocol.FoldingRange, error)
- func (s *Server) Formatting(ctx context.Context, params *protocol.DocumentFormattingParams) ([]protocol.TextEdit, error)
- func (s *Server) Hover(ctx context.Context, params *protocol.HoverParams) (result *protocol.Hover, err error)
- func (s *Server) Implementation(ctx context.Context, params *protocol.ImplementationParams) ([]protocol.Location, error)
- func (*Server) IncomingCalls(context.Context, *protocol.CallHierarchyIncomingCallsParams) ([]protocol.CallHierarchyIncomingCall, error)
- func (s *Server) Initialize(ctx context.Context, params *protocol.ParamInitialize) (result *protocol.InitializeResult, err error)
- func (s *Server) Initialized(ctx context.Context, params *protocol.InitializedParams) (err error)
- func (s *Server) InlayHint(ctx context.Context, params *protocol.InlayHintParams) ([]protocol.InlayHint, error)
- func (*Server) InlayHintRefresh(context.Context) error
- func (*Server) InlineCompletion(context.Context, *protocol.InlineCompletionParams) (*protocol.Or_Result_textDocument_inlineCompletion, error)
- func (*Server) InlineValue(context.Context, *protocol.InlineValueParams) ([]protocol.Or_InlineValue, error)
- func (*Server) InlineValueRefresh(context.Context) error
- func (*Server) LinkedEditingRange(context.Context, *protocol.LinkedEditingRangeParams) (*protocol.LinkedEditingRanges, error)
- func (*Server) Moniker(context.Context, *protocol.MonikerParams) ([]protocol.Moniker, error)
- func (*Server) OnTypeFormatting(context.Context, *protocol.DocumentOnTypeFormattingParams) ([]protocol.TextEdit, error)
- func (*Server) OutgoingCalls(context.Context, *protocol.CallHierarchyOutgoingCallsParams) ([]protocol.CallHierarchyOutgoingCall, error)
- func (*Server) PrepareCallHierarchy(context.Context, *protocol.CallHierarchyPrepareParams) ([]protocol.CallHierarchyItem, error)
- func (s *Server) PrepareRename(ctx context.Context, params *protocol.PrepareRenameParams) (*protocol.PrepareRenameResult, error)
- func (*Server) PrepareTypeHierarchy(context.Context, *protocol.TypeHierarchyPrepareParams) ([]protocol.TypeHierarchyItem, error)
- func (*Server) Progress(context.Context, *protocol.ProgressParams) error
- func (s *Server) RangeFormatting(ctx context.Context, params *protocol.DocumentRangeFormattingParams) ([]protocol.TextEdit, error)
- func (*Server) RangesFormatting(context.Context, *protocol.DocumentRangesFormattingParams) ([]protocol.TextEdit, error)
- func (s *Server) References(ctx context.Context, params *protocol.ReferenceParams) ([]protocol.Location, error)
- func (s *Server) Rename(ctx context.Context, params *protocol.RenameParams) (*protocol.WorkspaceEdit, error)
- func (*Server) Resolve(context.Context, *protocol.InlayHint) (*protocol.InlayHint, error)
- func (s *Server) ResolveCodeAction(ctx context.Context, codeAction *protocol.CodeAction) (*protocol.CodeAction, error)
- func (*Server) ResolveCodeLens(context.Context, *protocol.CodeLens) (*protocol.CodeLens, error)
- func (*Server) ResolveCompletionItem(context.Context, *protocol.CompletionItem) (*protocol.CompletionItem, error)
- func (*Server) ResolveDocumentLink(context.Context, *protocol.DocumentLink) (*protocol.DocumentLink, error)
- func (*Server) ResolveWorkspaceSymbol(context.Context, *protocol.WorkspaceSymbol) (*protocol.WorkspaceSymbol, error)
- func (*Server) SelectionRange(context.Context, *protocol.SelectionRangeParams) ([]protocol.SelectionRange, error)
- func (s *Server) SemanticTokensFull(ctx context.Context, params *protocol.SemanticTokensParams) (result *protocol.SemanticTokens, err error)
- func (s *Server) SemanticTokensFullDelta(ctx context.Context, params *protocol.SemanticTokensDeltaParams) (result interface{}, err error)
- func (s *Server) SemanticTokensRange(ctx context.Context, params *protocol.SemanticTokensRangeParams) (result *protocol.SemanticTokens, err error)
- func (s *Server) SemanticTokensRefresh(ctx context.Context) (err error)
- func (*Server) SetTrace(context.Context, *protocol.SetTraceParams) error
- func (s *Server) Shutdown(ctx context.Context) error
- func (*Server) SignatureHelp(context.Context, *protocol.SignatureHelpParams) (*protocol.SignatureHelp, error)
- func (*Server) Subtypes(context.Context, *protocol.TypeHierarchySubtypesParams) ([]protocol.TypeHierarchyItem, error)
- func (*Server) Supertypes(context.Context, *protocol.TypeHierarchySupertypesParams) ([]protocol.TypeHierarchyItem, error)
- func (s *Server) Symbol(ctx context.Context, params *protocol.WorkspaceSymbolParams) ([]protocol.SymbolInformation, error)
- func (*Server) TypeDefinition(context.Context, *protocol.TypeDefinitionParams) ([]protocol.Location, error)
- func (*Server) WillCreateFiles(context.Context, *protocol.CreateFilesParams) (*protocol.WorkspaceEdit, error)
- func (*Server) WillDeleteFiles(context.Context, *protocol.DeleteFilesParams) (*protocol.WorkspaceEdit, error)
- func (*Server) WillRenameFiles(context.Context, *protocol.RenameFilesParams) (*protocol.WorkspaceEdit, error)
- func (*Server) WillSave(context.Context, *protocol.WillSaveTextDocumentParams) error
- func (s *Server) WillSaveWaitUntil(ctx context.Context, params *protocol.WillSaveTextDocumentParams) ([]protocol.TextEdit, error)
- func (*Server) WorkDoneProgressCancel(context.Context, *protocol.WorkDoneProgressCancelParams) error
- type ServerOption
- type ServerOptions
- type Settings
- type SyntheticFileContentsRequest
- type UnknownCommand
- type UnknownCommandHandler
- type WorkspaceDescriptors
Constants ¶
const ( PragmaNoFormat = "nofmt" PragmaNoGenerate = "nogen" PragmaDebug = "debug" PragmaDebugWnoerror = "Wnoerror" WnoerrorAll = "all" )
Variables ¶
var DebugCheckOverlappingTokens = (debugCheckOverlappingTokens == "true")
var ErrNoDescriptorFound = fmt.Errorf("failed to find descriptor")
var ErrNoModule = errors.New("no go module found")
Functions ¶
func DecodeRawFileDescriptor ¶
func DecodeRawFileDescriptor(data []byte) (*descriptorpb.FileDescriptorProto, error)
func FindRefactorActions ¶
func FindRefactorActions(ctx context.Context, request *protocol.CodeActionParams, linkRes linker.Result, mapper *protocol.Mapper, want map[protocol.CodeActionKind]bool) []protocol.CodeAction
func FindSuffixMatchedPath ¶
func GoIdent ¶
func GoIdent(desc protoreflect.Descriptor) string
func IsWellKnownPath ¶
func NewSelectRangeCommand ¶
func NewSelectRangeCommand(params SelectRangeParams) *protocol.Command
func RefactorUndeclaredName ¶
func RefactorUndeclaredName(ctx context.Context, cache *Cache, uri protocol.DocumentURI, name string, kind protocol.CodeActionKind) []protocol.CodeAction
Types ¶
type Analyzer ¶
type Analyzer func(ctx context.Context, request *protocol.CodeActionParams, linkRes linker.Result, mapper *protocol.Mapper, results chan<- protocol.CodeAction)
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is responsible for keeping track of all the known proto source files and definitions.
func NewCache ¶
func NewCache(workspace protocol.WorkspaceFolder, opts ...CacheOption) *Cache
func (*Cache) ChangedText ¶
func (s *Cache) ChangedText(ctx context.Context, uri protocol.VersionedTextDocumentIdentifier, changes []protocol.TextDocumentContentChangeEvent) ([]byte, error)
func (*Cache) ComputeCodeLens ¶
func (*Cache) ComputeDocumentLinks ¶
func (c *Cache) ComputeDocumentLinks(doc protocol.TextDocumentIdentifier) ([]protocol.DocumentLink, error)
func (*Cache) ComputeHover ¶
func (*Cache) ComputeInlayHints ¶
func (*Cache) ComputeSemanticTokens ¶
func (c *Cache) ComputeSemanticTokens(doc protocol.TextDocumentIdentifier) ([]uint32, error)
func (*Cache) ComputeSemanticTokensRange ¶
func (*Cache) DidChangeConfiguration ¶
func (*Cache) DidModifyFiles ¶
func (c *Cache) DidModifyFiles(ctx context.Context, modifications []file.Modification)
func (*Cache) DocumentSymbolsForFile ¶
func (c *Cache) DocumentSymbolsForFile(uri protocol.DocumentURI) ([]protocol.DocumentSymbol, error)
func (*Cache) FindAllDescriptorsByPrefix ¶
func (c *Cache) FindAllDescriptorsByPrefix(ctx context.Context, prefix string, filter ...func(protoreflect.Descriptor) bool) WorkspaceDescriptors
func (*Cache) FindAllDescriptorsByQualifiedPrefix ¶
func (c *Cache) FindAllDescriptorsByQualifiedPrefix(ctx context.Context, prefix string, filter ...func(protoreflect.Descriptor) bool) WorkspaceDescriptors
Like FindAllDescriptorsByPrefix, but assumes a fully qualified prefix with package name.
func (*Cache) FindDefinitionForTypeDescriptor ¶
func (c *Cache) FindDefinitionForTypeDescriptor(desc protoreflect.Descriptor) (protocol.Location, error)
func (*Cache) FindDescriptorByName ¶
func (c *Cache) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error)
FindDescriptorByName implements linker.Resolver.
func (*Cache) FindExtensionByName ¶
func (c *Cache) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error)
FindExtensionByName implements linker.Resolver.
func (*Cache) FindExtensionByNumber ¶
func (c *Cache) FindExtensionByNumber(message protoreflect.FullName, field protowire.Number) (protoreflect.ExtensionType, error)
FindExtensionByNumber implements linker.Resolver.
func (*Cache) FindExtensionsByMessage ¶
func (c *Cache) FindExtensionsByMessage(message protoreflect.FullName) []protoreflect.ExtensionDescriptor
FindExtensionByNumber implements linker.Resolver.
func (*Cache) FindFileByURI ¶
func (c *Cache) FindFileByURI(uri protocol.DocumentURI) (protoreflect.FileDescriptor, error)
func (*Cache) FindGeneratedDefinition ¶
func (*Cache) FindImportPathsByPrefix ¶
func (*Cache) FindMessageByName ¶
func (c *Cache) FindMessageByName(name protoreflect.FullName) (protoreflect.MessageType, error)
FindMessageByName implements linker.Resolver.
func (*Cache) FindMessageByURL ¶
func (c *Cache) FindMessageByURL(url string) (protoreflect.MessageType, error)
FindMessageByURL implements linker.Resolver.
func (*Cache) FindPackageNameRefs ¶
func (*Cache) FindParseResultByPath ¶
func (*Cache) FindParseResultByURI ¶
func (*Cache) FindPragmasByPath ¶
func (c *Cache) FindPragmasByPath(path protocompile.ResolvedPath) (Pragmas, bool)
func (*Cache) FindReferenceLocationsForTypeDescriptor ¶
func (c *Cache) FindReferenceLocationsForTypeDescriptor(desc protoreflect.Descriptor) ([]protocol.Location, error)
func (*Cache) FindReferences ¶
func (c *Cache) FindReferences(ctx context.Context, params protocol.TextDocumentPositionParams, refCtx protocol.ReferenceContext) ([]protocol.Location, error)
func (*Cache) FindReferencesForTypeDescriptor ¶
func (c *Cache) FindReferencesForTypeDescriptor(desc protoreflect.Descriptor) ([]ast.NodeReference, error)
func (*Cache) FindResultByPath ¶
func (*Cache) FindResultByURI ¶
func (*Cache) FindResultOrPartialResultByPath ¶
func (*Cache) FindResultOrPartialResultByURI ¶
func (*Cache) FindTypeDescriptorAtLocation ¶
func (c *Cache) FindTypeDescriptorAtLocation(params protocol.TextDocumentPositionParams) (protoreflect.Descriptor, protocol.Range, error)
func (*Cache) FormatDocument ¶
func (c *Cache) FormatDocument(doc protocol.TextDocumentIdentifier, options protocol.FormattingOptions, maybeRange ...protocol.Range) ([]protocol.TextEdit, error)
func (*Cache) GetCodeActions ¶
func (c *Cache) GetCodeActions(ctx context.Context, params *protocol.CodeActionParams) ([]protocol.CodeAction, error)
func (*Cache) GetCompletions ¶
func (c *Cache) GetCompletions(params *protocol.CompletionParams) (result *protocol.CompletionList, err error)
func (*Cache) GetSyntheticFileContents ¶
func (*Cache) LatestDocumentContentsWellFormed ¶
func (c *Cache) LatestDocumentContentsWellFormed(uri protocol.DocumentURI, strict bool) (bool, error)
Checks if the most recently parsed version of the given document has any syntax errors, as reported by the diagnostic handler.
func (*Cache) PrepareRename ¶
func (c *Cache) PrepareRename(in protocol.TextDocumentPositionParams) (*protocol.PrepareRenameResult, error)
func (*Cache) QueryWorkspaceSymbols ¶
func (*Cache) RangeAllDescriptors ¶
func (c *Cache) RangeAllDescriptors(ctx context.Context, fn func(protoreflect.Descriptor) bool) error
RangeAllDescriptors calls fn for each descriptor in the cache, possibly in a separate goroutine for each file.
func (*Cache) Rename ¶
func (c *Cache) Rename(params *protocol.RenameParams) (*protocol.WorkspaceEdit, error)
func (*Cache) StreamWorkspaceDiagnostics ¶
func (c *Cache) StreamWorkspaceDiagnostics(ctx context.Context, ch chan<- protocol.WorkspaceFullDocumentDiagnosticReport)
func (*Cache) TryFindPackageReferences ¶
func (c *Cache) TryFindPackageReferences(params protocol.TextDocumentPositionParams) []protocol.Location
func (*Cache) WaitDocumentVersion ¶
func (*Cache) XGetAllDiagnostics ¶
func (c *Cache) XGetAllDiagnostics() (map[protocol.DocumentURI][]protocol.Diagnostic, error)
Intended for use with external tools only, not part of LSP implementation.
func (*Cache) XGetAllMessages ¶
func (c *Cache) XGetAllMessages() []protoreflect.MessageDescriptor
func (*Cache) XGetLinkerResults ¶
Intended for use with external tools only, not part of LSP implementation.
func (*Cache) XGetMapper ¶
func (*Cache) XGetResolver ¶
func (*Cache) XGetURIPathMappings ¶
func (c *Cache) XGetURIPathMappings() PathMappings
func (*Cache) XListWorkspaceLocalURIs ¶
func (c *Cache) XListWorkspaceLocalURIs() []protocol.DocumentURI
type CacheOption ¶
type CacheOption func(*CacheOptions)
type CacheOptions ¶
type CacheOptions struct{}
type CodeAction ¶
type Compiler ¶
type Compiler struct { *protocompile.Compiler // contains filtered or unexported fields }
type DiagnosticData ¶
type DiagnosticData struct { CodeActions []CodeAction `json:"codeActions"` Metadata map[string]string `json:"metadata"` }
type DiagnosticEvent ¶
type DiagnosticEvent int
type DiagnosticHandler ¶
type DiagnosticHandler struct {
// contains filtered or unexported fields
}
func NewDiagnosticHandler ¶
func NewDiagnosticHandler() *DiagnosticHandler
func (*DiagnosticHandler) ClearDiagnosticsForPath ¶
func (dr *DiagnosticHandler) ClearDiagnosticsForPath(path string)
func (*DiagnosticHandler) Flush ¶
func (dr *DiagnosticHandler) Flush()
func (*DiagnosticHandler) FullDiagnosticSnapshot ¶
func (dr *DiagnosticHandler) FullDiagnosticSnapshot() map[string][]*ProtoDiagnostic
func (*DiagnosticHandler) GetDiagnosticsForPath ¶
func (dr *DiagnosticHandler) GetDiagnosticsForPath(path string, prevResultId ...string) ([]*ProtoDiagnostic, string, bool)
func (*DiagnosticHandler) HandleError ¶
func (dr *DiagnosticHandler) HandleError(err reporter.ErrorWithPos) error
func (*DiagnosticHandler) HandleWarning ¶
func (dr *DiagnosticHandler) HandleWarning(err reporter.ErrorWithPos)
func (*DiagnosticHandler) Stream ¶
func (dr *DiagnosticHandler) Stream(ctx context.Context, callback ListenerFunc)
type DiagnosticList ¶
type DiagnosticList struct {
// contains filtered or unexported fields
}
func (*DiagnosticList) Add ¶
func (dl *DiagnosticList) Add(d *ProtoDiagnostic)
func (*DiagnosticList) Clear ¶
func (dl *DiagnosticList) Clear() []*ProtoDiagnostic
func (*DiagnosticList) DeleteRelated ¶
func (dl *DiagnosticList) DeleteRelated(related RelatedInformation)
func (*DiagnosticList) Flush ¶
func (dl *DiagnosticList) Flush() ([]*ProtoDiagnostic, string, bool)
func (*DiagnosticList) Get ¶
func (dl *DiagnosticList) Get(prevResultId ...string) (diagnostics []*ProtoDiagnostic, resultId string, unchanged bool)
type DocumentASTRequest ¶
type GenerateCodeRequest ¶
type GenerateCodeRequest struct { // The URIs of the files to generate code for. All URIs in this list must // belong to the same workspace; the server will look at the first URI in // the list to determine which workspace to use. URIs []protocol.DocumentURI `json:"uris"` }
type GenerateWorkspaceRequest ¶
type GenerateWorkspaceRequest struct {
Workspace protocol.WorkspaceFolder `json:"workspace"`
}
type GeneratedDefinitionParams ¶
type GeneratedDefinitionParams struct {
protocol.TextDocumentPositionParams
}
type GoLanguageDriver ¶
type GoLanguageDriver struct {
// contains filtered or unexported fields
}
func NewGoLanguageDriver ¶
func NewGoLanguageDriver(workdir string) *GoLanguageDriver
func (*GoLanguageDriver) FindGeneratedFiles ¶
func (s *GoLanguageDriver) FindGeneratedFiles(uri protocol.DocumentURI, fileOpts *descriptorpb.FileOptions, matchSourcePath string) ([]ParsedGoFile, error)
func (*GoLanguageDriver) HasGoModule ¶
func (s *GoLanguageDriver) HasGoModule() bool
func (*GoLanguageDriver) ImplicitGoPackagePath ¶
func (s *GoLanguageDriver) ImplicitGoPackagePath(filename string) (string, error)
func (*GoLanguageDriver) ImportFromGoModule ¶
func (s *GoLanguageDriver) ImportFromGoModule(importName string) (GoModuleImportResults, error)
func (*GoLanguageDriver) RefreshModules ¶
func (s *GoLanguageDriver) RefreshModules()
func (*GoLanguageDriver) SynthesizeFromGoSource ¶
func (s *GoLanguageDriver) SynthesizeFromGoSource(importName string, res GoModuleImportResults) (desc *descriptorpb.FileDescriptorProto, _err error)
type GoModuleImportResults ¶
type ImportSource ¶
type ImportSource int
const ( SourceWellKnown ImportSource = iota + 1 SourceRelativePath SourceLocalGoModule SourceGoModuleCache SourceSynthetic )
type InlayHintsSettings ¶
type InlayHintsSettings struct { ExtensionTypes *bool `mapstructure:"extensionTypes"` Imports *bool `mapstructure:"imports"` }
func (*InlayHintsSettings) GetExtensionTypes ¶
func (s *InlayHintsSettings) GetExtensionTypes() bool
func (*InlayHintsSettings) GetImports ¶
func (s *InlayHintsSettings) GetImports() bool
type ListenerFunc ¶
type ListenerFunc = func(path string, resultId string, diagnostics []*ProtoDiagnostic)
type ParsedGoFile ¶
type PathMappings ¶
type PathMappings struct { FileURIsByPath map[string]protocol.DocumentURI FilePathsByURI map[protocol.DocumentURI]string SyntheticFileOriginalNamesByURI map[protocol.DocumentURI]string }
type PreambleInfo ¶
func ParseGeneratedPreamble ¶
func ParseGeneratedPreamble(f *goast.File) (PreambleInfo, bool)
type ProtoDiagnostic ¶
type ProtoDiagnostic struct { Path string Version int32 Range ast.SourceSpan Severity protocol.DiagnosticSeverity Error error Tags []protocol.DiagnosticTag RelatedInformation []RelatedInformation CodeActions []CodeAction Metadata map[string]string // If this is a warning being treated as an error, WerrorCategory will be set to // a category that can be named in a debug pragma to disable it. WerrorCategory string }
type RefreshModulesRequest ¶
type RefreshModulesRequest struct {
Workspace protocol.WorkspaceFolder `json:"workspace"`
}
type ReindexWorkspacesRequest ¶
type ReindexWorkspacesRequest struct{}
type RelatedInformation ¶
type RelatedInformation struct { Range ast.SourceSpan Message string }
type Resolver ¶
func NewResolver ¶
func NewResolver(folder protocol.WorkspaceFolder) *Resolver
func (*Resolver) CheckIncompleteDescriptors ¶
CheckIncompleteDescriptors fills in placeholder sources for synthetic files that did not have fully linked descriptors at the time of creation, and returns a list of paths that need to be compiled again.
func (*Resolver) FindFileByPath ¶
func (r *Resolver) FindFileByPath(path protocompile.UnresolvedPath, whence protocompile.ImportContext) (protocompile.SearchResult, error)
Path resolution order: 1. Check for well-known import paths like google/* 2. Check if the path is a file on disk 3. Check if the path is a go module containing proto sources 3.5. Check if the path is a go module path containing generated code, but no proto sources 4. Check if the path is found in the global message cache 5. Try more complex path resolution strategies 6. Try to analyze existing generated code to find the path used to generate it
func (*Resolver) FindGeneratedFiles ¶
func (r *Resolver) FindGeneratedFiles(uri protocol.DocumentURI, fd protoreflect.FileDescriptor) ([]ParsedGoFile, error)
func (*Resolver) IsRealWorkspaceLocalFile ¶
func (r *Resolver) IsRealWorkspaceLocalFile(uri protocol.DocumentURI) bool
func (*Resolver) LookupGoModule ¶
func (*Resolver) OpenFileFromDisk ¶
func (*Resolver) PathToURI ¶
func (r *Resolver) PathToURI(path string) (protocol.DocumentURI, error)
func (*Resolver) PreloadWellKnownPaths ¶
func (r *Resolver) PreloadWellKnownPaths()
func (*Resolver) SyntheticFileContents ¶
func (r *Resolver) SyntheticFileContents(uri protocol.DocumentURI) (string, error)
func (*Resolver) SyntheticFiles ¶
func (r *Resolver) SyntheticFiles() []protocol.DocumentURI
func (*Resolver) UpdateURIPathMappings ¶
func (r *Resolver) UpdateURIPathMappings(modifications []file.Modification)
type SelectRangeParams ¶
type SelectRangeParams struct { // A range in the current document that should be selected. Setting the // start and end position to the same location has the effect of // moving the cursor to that location. SelectRange protocol.Range `json:"selectRange"` // A range in the current document that will be revealed by the editor. RevealRange protocol.Range `json:"revealRange"` // Whether to highlight the revealed range. HighlightRevealedRange bool `json:"highlightRevealedRange"` }
type Server ¶
type Server struct { ServerOptions // contains filtered or unexported fields }
func NewServer ¶
func NewServer(client protocol.ClientCloser, opts ...ServerOption) *Server
func (*Server) CacheForURI ¶
func (s *Server) CacheForURI(uri protocol.DocumentURI) (*Cache, error)
func (*Server) CacheForWorkspace ¶
func (s *Server) CacheForWorkspace(workspace protocol.WorkspaceFolder) (*Cache, error)
func (*Server) CodeAction ¶
func (s *Server) CodeAction(ctx context.Context, params *protocol.CodeActionParams) ([]protocol.CodeAction, error)
CodeAction implements protocol.Server.
func (*Server) CodeLens ¶
func (s *Server) CodeLens(ctx context.Context, params *protocol.CodeLensParams) (result []protocol.CodeLens, err error)
CodeLens implements protocol.Server.
func (*Server) CodeLensRefresh ¶
CodeLensRefresh implements protocol.Server.
func (*Server) CodeLensResolve ¶
func (s *Server) CodeLensResolve(ctx context.Context, params *protocol.CodeLens) (result *protocol.CodeLens, err error)
CodeLensResolve implements protocol.Server.
func (*Server) ColorPresentation ¶
func (s *Server) ColorPresentation(ctx context.Context, params *protocol.ColorPresentationParams) (result []protocol.ColorPresentation, err error)
ColorPresentation implements protocol.Server.
func (*Server) Completion ¶
func (s *Server) Completion(ctx context.Context, params *protocol.CompletionParams) (result *protocol.CompletionList, err error)
Completion implements protocol.Server.
func (*Server) CompletionResolve ¶
func (s *Server) CompletionResolve(ctx context.Context, params *protocol.CompletionItem) (result *protocol.CompletionItem, err error)
CompletionResolve implements protocol.Server.
func (*Server) Declaration ¶
func (*Server) Declaration(context.Context, *protocol.DeclarationParams) (*protocol.Or_textDocument_declaration, error)
Declaration implements protocol.Server.
func (*Server) Definition ¶
func (s *Server) Definition(ctx context.Context, params *protocol.DefinitionParams) (result []protocol.Location, err error)
Definition implements protocol.Server.
func (*Server) Diagnostic ¶
func (s *Server) Diagnostic(ctx context.Context, params *protocol.DocumentDiagnosticParams) (*protocol.Or_DocumentDiagnosticReport, error)
Diagnostic implements protocol.Server.
func (*Server) DiagnosticRefresh ¶
DiagnosticRefresh implements protocol.Server.
func (*Server) DiagnosticWorkspace ¶
func (s *Server) DiagnosticWorkspace(ctx context.Context, params *protocol.WorkspaceDiagnosticParams) (*protocol.WorkspaceDiagnosticReport, error)
DiagnosticWorkspace implements protocol.Server.
func (*Server) DidChange ¶
func (s *Server) DidChange(ctx context.Context, params *protocol.DidChangeTextDocumentParams) (err error)
DidChange implements protocol.Server.
func (*Server) DidChangeConfiguration ¶
func (s *Server) DidChangeConfiguration(ctx context.Context, params *protocol.DidChangeConfigurationParams) error
DidChangeConfiguration implements protocol.Server.
func (*Server) DidChangeNotebookDocument ¶
func (*Server) DidChangeNotebookDocument(context.Context, *protocol.DidChangeNotebookDocumentParams) error
DidChangeNotebookDocument implements protocol.Server.
func (*Server) DidChangeWatchedFiles ¶
func (s *Server) DidChangeWatchedFiles(ctx context.Context, params *protocol.DidChangeWatchedFilesParams) error
DidChangeWatchedFiles implements protocol.Server.
func (*Server) DidChangeWorkspaceFolders ¶
func (s *Server) DidChangeWorkspaceFolders(ctx context.Context, params *protocol.DidChangeWorkspaceFoldersParams) error
DidChangeWorkspaceFolders implements protocol.Server.
func (*Server) DidClose ¶
func (s *Server) DidClose(ctx context.Context, params *protocol.DidCloseTextDocumentParams) (err error)
DidClose implements protocol.Server.
func (*Server) DidCloseNotebookDocument ¶
func (*Server) DidCloseNotebookDocument(context.Context, *protocol.DidCloseNotebookDocumentParams) error
DidCloseNotebookDocument implements protocol.Server.
func (*Server) DidCreateFiles ¶
func (s *Server) DidCreateFiles(ctx context.Context, params *protocol.CreateFilesParams) (err error)
DidCreateFiles implements protocol.Server.
func (*Server) DidDeleteFiles ¶
func (s *Server) DidDeleteFiles(ctx context.Context, params *protocol.DeleteFilesParams) (err error)
DidDeleteFiles implements protocol.Server.
func (*Server) DidOpen ¶
func (s *Server) DidOpen(ctx context.Context, params *protocol.DidOpenTextDocumentParams) (err error)
DidOpen implements protocol.Server.
func (*Server) DidOpenNotebookDocument ¶
func (*Server) DidOpenNotebookDocument(context.Context, *protocol.DidOpenNotebookDocumentParams) error
DidOpenNotebookDocument implements protocol.Server.
func (*Server) DidRenameFiles ¶
func (s *Server) DidRenameFiles(ctx context.Context, params *protocol.RenameFilesParams) (err error)
DidRenameFiles implements protocol.Server.
func (*Server) DidSave ¶
func (s *Server) DidSave(ctx context.Context, params *protocol.DidSaveTextDocumentParams) (err error)
DidSave implements protocol.Server.
func (*Server) DidSaveNotebookDocument ¶
func (*Server) DidSaveNotebookDocument(context.Context, *protocol.DidSaveNotebookDocumentParams) error
DidSaveNotebookDocument implements protocol.Server.
func (*Server) DocumentColor ¶
func (*Server) DocumentColor(context.Context, *protocol.DocumentColorParams) ([]protocol.ColorInformation, error)
DocumentColor implements protocol.Server.
func (*Server) DocumentHighlight ¶
func (*Server) DocumentHighlight(context.Context, *protocol.DocumentHighlightParams) ([]protocol.DocumentHighlight, error)
DocumentHighlight implements protocol.Server.
func (*Server) DocumentLink ¶
func (s *Server) DocumentLink(ctx context.Context, params *protocol.DocumentLinkParams) ([]protocol.DocumentLink, error)
DocumentLink implements protocol.Server.
func (*Server) DocumentSymbol ¶
func (s *Server) DocumentSymbol(ctx context.Context, params *protocol.DocumentSymbolParams) (result []interface{}, err error)
DocumentSymbol implements protocol.Server.
func (*Server) ExecuteCommand ¶
func (s *Server) ExecuteCommand(ctx context.Context, params *protocol.ExecuteCommandParams) (any, error)
ExecuteCommand implements protocol.Server.
func (*Server) FoldingRange ¶
func (*Server) FoldingRange(context.Context, *protocol.FoldingRangeParams) ([]protocol.FoldingRange, error)
FoldingRange implements protocol.Server.
func (*Server) Formatting ¶
func (s *Server) Formatting(ctx context.Context, params *protocol.DocumentFormattingParams) ([]protocol.TextEdit, error)
Formatting implements protocol.Server.
func (*Server) Hover ¶
func (s *Server) Hover(ctx context.Context, params *protocol.HoverParams) (result *protocol.Hover, err error)
Hover implements protocol.Server.
func (*Server) Implementation ¶
func (s *Server) Implementation(ctx context.Context, params *protocol.ImplementationParams) ([]protocol.Location, error)
Implementation implements protocol.Server.
func (*Server) IncomingCalls ¶
func (*Server) IncomingCalls(context.Context, *protocol.CallHierarchyIncomingCallsParams) ([]protocol.CallHierarchyIncomingCall, error)
IncomingCalls implements protocol.Server.
func (*Server) Initialize ¶
func (s *Server) Initialize(ctx context.Context, params *protocol.ParamInitialize) (result *protocol.InitializeResult, err error)
Initialize implements protocol.Server.
func (*Server) Initialized ¶
Initialized implements protocol.Server.
func (*Server) InlayHint ¶
func (s *Server) InlayHint(ctx context.Context, params *protocol.InlayHintParams) ([]protocol.InlayHint, error)
InlayHint implements protocol.Server.
func (*Server) InlayHintRefresh ¶
InlayHintRefresh implements protocol.Server.
func (*Server) InlineCompletion ¶
func (*Server) InlineCompletion(context.Context, *protocol.InlineCompletionParams) (*protocol.Or_Result_textDocument_inlineCompletion, error)
InlineCompletion implements protocol.Server.
func (*Server) InlineValue ¶
func (*Server) InlineValue(context.Context, *protocol.InlineValueParams) ([]protocol.Or_InlineValue, error)
InlineValue implements protocol.Server.
func (*Server) InlineValueRefresh ¶
InlineValueRefresh implements protocol.Server.
func (*Server) LinkedEditingRange ¶
func (*Server) LinkedEditingRange(context.Context, *protocol.LinkedEditingRangeParams) (*protocol.LinkedEditingRanges, error)
LinkedEditingRange implements protocol.Server.
func (*Server) OnTypeFormatting ¶
func (*Server) OnTypeFormatting(context.Context, *protocol.DocumentOnTypeFormattingParams) ([]protocol.TextEdit, error)
OnTypeFormatting implements protocol.Server.
func (*Server) OutgoingCalls ¶
func (*Server) OutgoingCalls(context.Context, *protocol.CallHierarchyOutgoingCallsParams) ([]protocol.CallHierarchyOutgoingCall, error)
OutgoingCalls implements protocol.Server.
func (*Server) PrepareCallHierarchy ¶
func (*Server) PrepareCallHierarchy(context.Context, *protocol.CallHierarchyPrepareParams) ([]protocol.CallHierarchyItem, error)
PrepareCallHierarchy implements protocol.Server.
func (*Server) PrepareRename ¶
func (s *Server) PrepareRename(ctx context.Context, params *protocol.PrepareRenameParams) (*protocol.PrepareRenameResult, error)
PrepareRename implements protocol.Server.
func (*Server) PrepareTypeHierarchy ¶
func (*Server) PrepareTypeHierarchy(context.Context, *protocol.TypeHierarchyPrepareParams) ([]protocol.TypeHierarchyItem, error)
PrepareTypeHierarchy implements protocol.Server.
func (*Server) RangeFormatting ¶
func (s *Server) RangeFormatting(ctx context.Context, params *protocol.DocumentRangeFormattingParams) ([]protocol.TextEdit, error)
RangeFormatting implements protocol.Server.
func (*Server) RangesFormatting ¶
func (*Server) RangesFormatting(context.Context, *protocol.DocumentRangesFormattingParams) ([]protocol.TextEdit, error)
RangesFormatting implements protocol.Server.
func (*Server) References ¶
func (s *Server) References(ctx context.Context, params *protocol.ReferenceParams) ([]protocol.Location, error)
References implements protocol.Server.
func (*Server) Rename ¶
func (s *Server) Rename(ctx context.Context, params *protocol.RenameParams) (*protocol.WorkspaceEdit, error)
Rename implements protocol.Server.
func (*Server) ResolveCodeAction ¶
func (s *Server) ResolveCodeAction(ctx context.Context, codeAction *protocol.CodeAction) (*protocol.CodeAction, error)
ResolveCodeAction implements protocol.Server.
func (*Server) ResolveCodeLens ¶
ResolveCodeLens implements protocol.Server.
func (*Server) ResolveCompletionItem ¶
func (*Server) ResolveCompletionItem(context.Context, *protocol.CompletionItem) (*protocol.CompletionItem, error)
ResolveCompletionItem implements protocol.Server.
func (*Server) ResolveDocumentLink ¶
func (*Server) ResolveDocumentLink(context.Context, *protocol.DocumentLink) (*protocol.DocumentLink, error)
ResolveDocumentLink implements protocol.Server.
func (*Server) ResolveWorkspaceSymbol ¶
func (*Server) ResolveWorkspaceSymbol(context.Context, *protocol.WorkspaceSymbol) (*protocol.WorkspaceSymbol, error)
ResolveWorkspaceSymbol implements protocol.Server.
func (*Server) SelectionRange ¶
func (*Server) SelectionRange(context.Context, *protocol.SelectionRangeParams) ([]protocol.SelectionRange, error)
SelectionRange implements protocol.Server.
func (*Server) SemanticTokensFull ¶
func (s *Server) SemanticTokensFull(ctx context.Context, params *protocol.SemanticTokensParams) (result *protocol.SemanticTokens, err error)
SemanticTokensFull implements protocol.Server.
func (*Server) SemanticTokensFullDelta ¶
func (s *Server) SemanticTokensFullDelta(ctx context.Context, params *protocol.SemanticTokensDeltaParams) (result interface{}, err error)
SemanticTokensFullDelta implements protocol.Server.
func (*Server) SemanticTokensRange ¶
func (s *Server) SemanticTokensRange(ctx context.Context, params *protocol.SemanticTokensRangeParams) (result *protocol.SemanticTokens, err error)
SemanticTokensRange implements protocol.Server.
func (*Server) SemanticTokensRefresh ¶
SemanticTokensRefresh implements protocol.Server.
func (*Server) SignatureHelp ¶
func (*Server) SignatureHelp(context.Context, *protocol.SignatureHelpParams) (*protocol.SignatureHelp, error)
SignatureHelp implements protocol.Server.
func (*Server) Subtypes ¶
func (*Server) Subtypes(context.Context, *protocol.TypeHierarchySubtypesParams) ([]protocol.TypeHierarchyItem, error)
Subtypes implements protocol.Server.
func (*Server) Supertypes ¶
func (*Server) Supertypes(context.Context, *protocol.TypeHierarchySupertypesParams) ([]protocol.TypeHierarchyItem, error)
Supertypes implements protocol.Server.
func (*Server) Symbol ¶
func (s *Server) Symbol(ctx context.Context, params *protocol.WorkspaceSymbolParams) ([]protocol.SymbolInformation, error)
Symbol implements protocol.Server.
func (*Server) TypeDefinition ¶
func (*Server) TypeDefinition(context.Context, *protocol.TypeDefinitionParams) ([]protocol.Location, error)
TypeDefinition implements protocol.Server.
func (*Server) WillCreateFiles ¶
func (*Server) WillCreateFiles(context.Context, *protocol.CreateFilesParams) (*protocol.WorkspaceEdit, error)
WillCreateFiles implements protocol.Server.
func (*Server) WillDeleteFiles ¶
func (*Server) WillDeleteFiles(context.Context, *protocol.DeleteFilesParams) (*protocol.WorkspaceEdit, error)
WillDeleteFiles implements protocol.Server.
func (*Server) WillRenameFiles ¶
func (*Server) WillRenameFiles(context.Context, *protocol.RenameFilesParams) (*protocol.WorkspaceEdit, error)
WillRenameFiles implements protocol.Server.
func (*Server) WillSaveWaitUntil ¶
func (s *Server) WillSaveWaitUntil(ctx context.Context, params *protocol.WillSaveTextDocumentParams) ([]protocol.TextEdit, error)
WillSaveWaitUntil implements protocol.Server.
func (*Server) WorkDoneProgressCancel ¶
func (*Server) WorkDoneProgressCancel(context.Context, *protocol.WorkDoneProgressCancelParams) error
WorkDoneProgressCancel implements protocol.Server.
type ServerOption ¶
type ServerOption func(*ServerOptions)
func WithUnknownCommandHandler ¶
func WithUnknownCommandHandler(handler UnknownCommandHandler, cmds ...string) ServerOption
type ServerOptions ¶
type ServerOptions struct {
// contains filtered or unexported fields
}
type Settings ¶
type Settings struct {
InlayHints InlayHintsSettings `mapstructure:"inlayHints"`
}
type SyntheticFileContentsRequest ¶
type SyntheticFileContentsRequest struct { // The URI of the file to update. URI string `json:"uri"` }
type UnknownCommand ¶
type UnknownCommand struct { Command string Arguments []json.RawMessage Cache *Cache }
type UnknownCommandHandler ¶
type UnknownCommandHandler interface {
Execute(ctx context.Context, uc UnknownCommand) (any, error)
}
type WorkspaceDescriptors ¶
type WorkspaceDescriptors interface { Len() int All() []protoreflect.Descriptor Range(func(path string, descriptors []protoreflect.Descriptor)) }
Source Files ¶
- cache.go
- codeactions.go
- codelens.go
- commands.go
- compiler.go
- completion.go
- diagnostics.go
- documents.go
- externalapi.go
- format.go
- generated.go
- golang.go
- hover.go
- inlayhints.go
- links.go
- packages.go
- pragmas.go
- range.go
- refactor.go
- references.go
- rename.go
- resolver.go
- search.go
- semantic.go
- server.go
- settings.go
- symbols.go
- tokentype_string.go
- versions.go
- wellknown.go