Documentation
¶
Index ¶
- func CompareSeverity(a, b Severity) int
- func DiagnosticSummary(values []Diagnostic) string
- func DocumentSymbolsFromProtocol(result lsp.DocumentSymbolResult) ([]lsp.DocumentSymbol, []lsp.SymbolInformation)
- func FormatDiagnosticLine(path string, diagnostic Diagnostic) string
- func FormatDiagnostics(values []Diagnostic, filePath, root string) string
- func HoverText(hover *lsp.Hover) string
- func SeverityName(severity Severity) string
- type Diagnostic
- type Position
- type Range
- type SemanticToken
- type Service
- func (s *Service) Activities() []lsp.ServerActivity
- func (s *Service) Capabilities(ctx context.Context, filePath string) (lsp.ServerCapabilities, bool, error)
- func (s *Service) Close()
- func (s *Service) CloseDocument(ctx context.Context, filePath string) error
- func (s *Service) CodeActions(ctx context.Context, filePath string, content *string, selection lsp.Range, ...) ([]lsp.CommandOrCodeAction, error)
- func (s *Service) CompletionItems(ctx context.Context, filePath string, content *string, line, column int, ...) (lsp.CompletionList, error)
- func (s *Service) DefinitionLocations(ctx context.Context, filePath string, content *string, line, column int) ([]lsp.Location, error)
- func (s *Service) Diagnostics(ctx context.Context) WorkspaceReport
- func (s *Service) DocumentContent(filePath string) (string, bool)
- func (s *Service) DocumentHighlights(ctx context.Context, filePath string, content *string, line, column int) ([]lsp.DocumentHighlight, error)
- func (s *Service) DocumentSymbols(ctx context.Context, filePath string, content *string) ([]lsp.DocumentSymbol, []lsp.SymbolInformation, error)
- func (s *Service) ExecuteCommand(ctx context.Context, filePath string, content *string, command lsp.Command) (any, error)
- func (s *Service) ExecuteCommandWithEdits(ctx context.Context, filePath string, content *string, command lsp.Command) (any, []lsp.CommandWorkspaceEdit, error)
- func (s *Service) FileDiagnostics(ctx context.Context, filePath string, content *string) ([]Diagnostic, bool, error)
- func (s *Service) FoldingRanges(ctx context.Context, filePath string, content *string) ([]lsp.FoldingRange, error)
- func (s *Service) Formatting(ctx context.Context, filePath string, content *string, ...) ([]lsp.TextEdit, error)
- func (s *Service) Graph() *graph.Engine
- func (s *Service) HasLSP() bool
- func (s *Service) HasLSPFor(filePath string) bool
- func (s *Service) Hover(ctx context.Context, filePath string, content *string, line, column int) (string, error)
- func (s *Service) ImplementationLocations(ctx context.Context, filePath string, content *string, line, column int) ([]lsp.Location, error)
- func (s *Service) InlayHints(ctx context.Context, filePath string, content *string, selection lsp.Range) ([]lsp.InlayHint, error)
- func (s *Service) InvalidateLSPDetection()
- func (s *Service) Manager() *lsp.Manager
- func (s *Service) OnTypeFormatting(ctx context.Context, filePath string, content *string, line, column int, ...) ([]lsp.TextEdit, error)
- func (s *Service) PostEditDiagnostics(ctx context.Context, filePath string) string
- func (s *Service) PrepareRename(ctx context.Context, filePath string, content *string, line, column int) (lsp.PrepareRenameResult, error)
- func (s *Service) RangeFormatting(ctx context.Context, filePath string, content *string, selection lsp.Range, ...) ([]lsp.TextEdit, error)
- func (s *Service) ReferenceLocations(ctx context.Context, filePath string, content *string, line, column int) ([]lsp.Location, error)
- func (s *Service) Rename(ctx context.Context, filePath string, content *string, line, column int, ...) (*lsp.WorkspaceEdit, error)
- func (s *Service) ResolveCodeAction(ctx context.Context, filePath string, content *string, action lsp.CodeAction) (*lsp.CodeAction, error)
- func (s *Service) ResolveCompletionItem(ctx context.Context, filePath string, content *string, item lsp.CompletionItem) (lsp.CompletionItem, error)
- func (s *Service) SemanticTokens(ctx context.Context, filePath string, content *string) ([]SemanticToken, error)
- func (s *Service) SetServerInitializationOptions(name string, value any) error
- func (s *Service) SignatureHelp(ctx context.Context, filePath string, content *string, line, column int, ...) (*lsp.SignatureHelp, error)
- func (s *Service) SyncDocument(ctx context.Context, filePath, content string, saved bool) error
- func (s *Service) TypeDefinitionLocations(ctx context.Context, filePath string, content *string, line, column int) ([]lsp.Location, error)
- func (s *Service) WarmUp()
- func (s *Service) WorkspaceSymbols(ctx context.Context, query string) ([]lsp.SymbolInformation, []lsp.WorkspaceSymbol, error)
- type Severity
- type WorkspaceReport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareSeverity ¶
func DiagnosticSummary ¶
func DiagnosticSummary(values []Diagnostic) string
func DocumentSymbolsFromProtocol ¶
func DocumentSymbolsFromProtocol(result lsp.DocumentSymbolResult) ([]lsp.DocumentSymbol, []lsp.SymbolInformation)
func FormatDiagnosticLine ¶
func FormatDiagnosticLine(path string, diagnostic Diagnostic) string
func FormatDiagnostics ¶
func FormatDiagnostics(values []Diagnostic, filePath, root string) string
func SeverityName ¶
Types ¶
type Diagnostic ¶
type Diagnostic struct {
Range Range `json:"range"`
Severity Severity `json:"severity,omitempty"`
Code any `json:"code,omitempty"`
Source string `json:"source,omitempty"`
Message string `json:"message"`
}
func DiagnosticsFromProtocol ¶
func DiagnosticsFromProtocol(values []lsp.Diagnostic) []Diagnostic
type SemanticToken ¶
type SemanticToken struct {
Line int `json:"line"`
Character int `json:"character"`
Length int `json:"length"`
Type string `json:"type"`
Modifiers []string `json:"modifiers,omitempty"`
}
SemanticToken is the expanded editor representation shared by the LSP and Tree-sitter providers. The LSP client itself keeps the protocol's raw, delta-encoded SemanticTokens value.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service owns the code-intelligence backends for one workspace. It is the only layer that chooses between language-server and structural results.
func (*Service) Activities ¶ added in v0.15.1
func (s *Service) Activities() []lsp.ServerActivity
func (*Service) Capabilities ¶
func (*Service) CloseDocument ¶
func (*Service) CodeActions ¶
func (s *Service) CodeActions(ctx context.Context, filePath string, content *string, selection lsp.Range, only []lsp.CodeActionKind, trigger lsp.CodeActionTriggerKind) ([]lsp.CommandOrCodeAction, error)
func (*Service) CompletionItems ¶
func (*Service) DefinitionLocations ¶
func (*Service) Diagnostics ¶
func (s *Service) Diagnostics(ctx context.Context) WorkspaceReport
func (*Service) DocumentHighlights ¶
func (*Service) DocumentSymbols ¶
func (s *Service) DocumentSymbols(ctx context.Context, filePath string, content *string) ([]lsp.DocumentSymbol, []lsp.SymbolInformation, error)
func (*Service) ExecuteCommand ¶
func (*Service) ExecuteCommandWithEdits ¶ added in v0.15.1
func (*Service) FileDiagnostics ¶
func (*Service) FoldingRanges ¶
func (*Service) Formatting ¶
func (*Service) ImplementationLocations ¶
func (*Service) InlayHints ¶
func (*Service) InvalidateLSPDetection ¶ added in v0.15.0
func (s *Service) InvalidateLSPDetection()
InvalidateLSPDetection makes managed-tool changes visible to subsequent capability and session lookups.
func (*Service) OnTypeFormatting ¶
func (*Service) PostEditDiagnostics ¶
func (*Service) PrepareRename ¶
func (*Service) RangeFormatting ¶
func (*Service) ReferenceLocations ¶
func (*Service) ResolveCodeAction ¶
func (s *Service) ResolveCodeAction(ctx context.Context, filePath string, content *string, action lsp.CodeAction) (*lsp.CodeAction, error)
func (*Service) ResolveCompletionItem ¶
func (s *Service) ResolveCompletionItem(ctx context.Context, filePath string, content *string, item lsp.CompletionItem) (lsp.CompletionItem, error)
func (*Service) SemanticTokens ¶
func (*Service) SetServerInitializationOptions ¶ added in v0.15.0
SetServerInitializationOptions refreshes a server's startup configuration.
func (*Service) SignatureHelp ¶
func (*Service) SyncDocument ¶
func (*Service) TypeDefinitionLocations ¶
func (*Service) WorkspaceSymbols ¶
func (s *Service) WorkspaceSymbols(ctx context.Context, query string) ([]lsp.SymbolInformation, []lsp.WorkspaceSymbol, error)
type WorkspaceReport ¶
Click to show internal directories.
Click to hide internal directories.