Documentation
¶
Overview ¶
Package codeintel provides local code-intelligence helpers for symbols, diagnostics, notebooks, and language-server queries.
Index ¶
- func EditNotebookCell(path string, index int, cellType string, source string) error
- func InferLanguageID(path string) string
- func LSPActionRequiresDocument(action string) (bool, error)
- func ModulePath(workspace string) (string, error)
- func NormalizeLSPAction(action string) (string, error)
- func NormalizeNotebookCellType(cellType string) (string, error)
- func NormalizeNotebookEditMode(mode string) (string, error)
- func ResolveNotebookEditIndex(path string, cellIndex *int, cellID string, mode string) (int, error)
- type CallHierarchyCall
- type CallHierarchyItem
- type CodeLens
- type CodeLensCommand
- type ColorPresentation
- type Completion
- type Diagnostic
- type DocumentColor
- type DocumentHighlight
- type DocumentLink
- type FixAllResult
- type FoldingRange
- type FormatResult
- type Hover
- type InlayHint
- type InlineValue
- type LSPActionInfo
- type LSPCandidate
- type LSPCodeDescription
- type LSPColor
- type LSPDiagnostic
- type LSPDiagnosticRelatedInformation
- type LSPFileEdit
- type LSPLocation
- type LSPNotification
- type LSPPosition
- type LSPQueryRequest
- type LSPQueryResult
- type LSPRange
- type LSPServer
- type LSPServerStatus
- type LSPStore
- func (s LSPStore) List() ([]LSPServerStatus, error)
- func (s LSPStore) Query(ctx context.Context, language string, request LSPQueryRequest) (LSPQueryResult, error)
- func (s LSPStore) Start(language string, commandArgs []string) (LSPServerStatus, error)
- func (s LSPStore) Status(language string) (LSPServerStatus, error)
- func (s LSPStore) Stop(language string) (LSPServerStatus, error)
- type LinkedEditingRange
- type MapEntry
- type Moniker
- type Notebook
- type NotebookCell
- type NotebookEditOptions
- type NotebookEditResult
- type NotebookReadCell
- type NotebookReadOptions
- type NotebookReadResult
- type OrganizeImportsResult
- type Reference
- type RenameFileEdit
- type RenamePrepareResult
- type RenameResult
- type RenameTextEdit
- type ResolvedSymbol
- type SelectionRange
- type SemanticToken
- type SemanticTokens
- type SemanticTokensDelta
- type Signature
- type SignatureArgument
- type SignatureHelp
- type Symbol
- type TypeHierarchyItem
- func PrepareTypeHierarchy(workspace string, symbol string, relPath string, line int, character int) ([]TypeHierarchyItem, error)
- func TypeHierarchySubtypes(workspace string, symbol string, limit int) ([]TypeHierarchyItem, error)
- func TypeHierarchySupertypes(workspace string, symbol string, limit int) ([]TypeHierarchyItem, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EditNotebookCell ¶
EditNotebookCell replaces one notebook cell with source and type.
func InferLanguageID ¶
InferLanguageID returns an LSP language identifier for a file path.
func LSPActionRequiresDocument ¶
LSPActionRequiresDocument reports whether an action must open a document.
func ModulePath ¶
ModulePath returns the module path from go.mod, or a stable workspace label when the workspace is not a Go module.
func NormalizeLSPAction ¶
NormalizeLSPAction returns the canonical name for an LSP action alias.
func NormalizeNotebookCellType ¶
NormalizeNotebookCellType returns the canonical notebook cell type.
func NormalizeNotebookEditMode ¶
NormalizeNotebookEditMode returns the canonical notebook edit mode.
Types ¶
type CallHierarchyCall ¶
type CallHierarchyCall struct {
From CallHierarchyItem `json:"from,omitempty"`
To CallHierarchyItem `json:"to,omitempty"`
FromRanges []LSPRange `json:"fromRanges"`
}
CallHierarchyCall describes a static relationship between two call hierarchy nodes.
func IncomingCalls ¶
func IncomingCalls(workspace string, symbol string, limit int) ([]CallHierarchyCall, error)
IncomingCalls returns static callers for a function.
func OutgoingCalls ¶
func OutgoingCalls(workspace string, symbol string, limit int) ([]CallHierarchyCall, error)
OutgoingCalls returns static callees from a function.
type CallHierarchyItem ¶
type CallHierarchyItem struct {
Name string `json:"name"`
Kind string `json:"kind"`
Path string `json:"path"`
Range LSPRange `json:"range"`
SelectionRange LSPRange `json:"selectionRange"`
}
CallHierarchyItem describes a static call hierarchy node.
func PrepareCallHierarchy ¶
func PrepareCallHierarchy(workspace string, symbol string, relPath string, line int, character int) ([]CallHierarchyItem, error)
PrepareCallHierarchy returns the static call hierarchy item for a symbol or document position.
type CodeLens ¶
type CodeLens struct {
Path string `json:"path"`
Range LSPRange `json:"range"`
Symbol string `json:"symbol"`
Kind string `json:"kind,omitempty"`
Command CodeLensCommand `json:"command"`
Data map[string]any `json:"data,omitempty"`
}
CodeLens describes a static editor action attached to a declaration.
type CodeLensCommand ¶
type CodeLensCommand struct {
Title string `json:"title"`
Command string `json:"command"`
Arguments []any `json:"arguments,omitempty"`
}
CodeLensCommand describes the command exposed by a code lens.
type ColorPresentation ¶
type ColorPresentation struct {
Label string `json:"label"`
Color DocumentColor `json:"color"`
}
ColorPresentation describes a textual rendering of a document color.
func ColorPresentations ¶
func ColorPresentations(workspace string, relPath string, line int, character int) ([]ColorPresentation, bool, error)
ColorPresentations returns static textual renderings for the color under a document position.
type Completion ¶
type Completion struct {
Label string `json:"label"`
Kind string `json:"kind"`
Path string `json:"path,omitempty"`
Line int `json:"line,omitempty"`
Detail string `json:"detail,omitempty"`
}
Completion describes a static completion candidate.
func Completions ¶
func Completions(workspace string, prefix string, limit int) ([]Completion, error)
Completions returns static Go symbol and keyword completions for a prefix.
type Diagnostic ¶
type Diagnostic struct {
Path string `json:"path,omitempty"`
Line int `json:"line,omitempty"`
Column int `json:"column,omitempty"`
Package string `json:"package,omitempty"`
Test string `json:"test,omitempty"`
Action string `json:"action,omitempty"`
Message string `json:"message"`
}
Diagnostic describes a build, test, or parser issue in a source file.
func GoDiagnostics ¶
GoDiagnostics returns diagnostics from `go test -json` for the workspace.
func ParseGoTestJSON ¶
func ParseGoTestJSON(workspace string, data []byte) ([]Diagnostic, error)
ParseGoTestJSON converts `go test -json` output into diagnostics.
type DocumentColor ¶
type DocumentColor struct {
Path string `json:"path"`
Text string `json:"text"`
Range LSPRange `json:"range"`
Color LSPColor `json:"color"`
}
DocumentColor describes one color literal discovered in a source document.
func DocumentColors ¶
func DocumentColors(workspace string, relPath string, limit int) ([]DocumentColor, error)
DocumentColors returns static hex color literals discovered in one source document.
type DocumentHighlight ¶
type DocumentHighlight struct {
Path string `json:"path"`
Range LSPRange `json:"range"`
Kind int `json:"kind,omitempty"`
Text string `json:"text,omitempty"`
}
DocumentHighlight describes one static symbol occurrence in a source file.
func DocumentHighlights ¶
func DocumentHighlights(workspace string, symbol string, relPath string, limit int) ([]DocumentHighlight, error)
DocumentHighlights returns static ranges for textual symbol occurrences.
type DocumentLink ¶
type DocumentLink struct {
Path string `json:"path"`
Target string `json:"target"`
Range LSPRange `json:"range"`
Tooltip string `json:"tooltip,omitempty"`
}
DocumentLink describes a URL range discovered in a source document.
func DocumentLinkAtPosition ¶
func DocumentLinkAtPosition(workspace string, relPath string, line int, character int) (DocumentLink, bool, error)
DocumentLinkAtPosition returns the static URL link containing a document position.
func DocumentLinks ¶
func DocumentLinks(workspace string, relPath string, limit int) ([]DocumentLink, error)
DocumentLinks returns static URL links discovered in one source document.
type FixAllResult ¶
type FixAllResult struct {
Kind string `json:"kind"`
Path string `json:"path"`
Changed bool `json:"changed"`
Bytes int `json:"bytes"`
Content string `json:"content,omitempty"`
Actions []string `json:"actions"`
OrganizeImports *OrganizeImportsResult `json:"organize_imports,omitempty"`
}
FixAllResult reports the preview for static source.fixAll behavior.
func FixAllGoFile ¶
func FixAllGoFile(workspace string, requested string, write bool) (FixAllResult, error)
FixAllGoFile previews or applies static source.fixAll behavior for a Go file.
type FoldingRange ¶
type FoldingRange struct {
Path string `json:"path"`
StartLine int `json:"startLine"`
EndLine int `json:"endLine"`
Kind string `json:"kind,omitempty"`
}
FoldingRange describes one static foldable range in a source file.
func FoldingRanges ¶
func FoldingRanges(workspace string, relPath string, limit int) ([]FoldingRange, error)
FoldingRanges returns static foldable ranges for Go source files.
type FormatResult ¶
type FormatResult struct {
Kind string `json:"kind"`
Path string `json:"path"`
Changed bool `json:"changed"`
Bytes int `json:"bytes"`
Content string `json:"content,omitempty"`
}
FormatResult reports the result of formatting a source file.
func FormatGoFile ¶
func FormatGoFile(workspace string, requested string, write bool) (FormatResult, error)
FormatGoFile formats a Go file and optionally writes the formatted content.
type Hover ¶
type Hover struct {
Symbol string `json:"symbol"`
Found bool `json:"found"`
Kind string `json:"kind,omitempty"`
Path string `json:"path,omitempty"`
Line int `json:"line,omitempty"`
Snippet []string `json:"snippet,omitempty"`
}
Hover contains static hover context for a discovered symbol.
type InlayHint ¶
type InlayHint struct {
Path string `json:"path"`
Position LSPPosition `json:"position"`
Label string `json:"label"`
Kind string `json:"kind,omitempty"`
Tooltip string `json:"tooltip,omitempty"`
PaddingRight bool `json:"paddingRight,omitempty"`
}
InlayHint describes a static editor hint for a document position.
type InlineValue ¶
type InlineValue struct {
Path string `json:"path"`
Name string `json:"name"`
Value string `json:"value"`
Text string `json:"text"`
Kind string `json:"kind,omitempty"`
Range LSPRange `json:"range"`
}
InlineValue describes a statically known value that can be shown inline in a source document.
func InlineValues ¶
func InlineValues(workspace string, relPath string, line int, character int, limit int) ([]InlineValue, error)
InlineValues returns simple statically known values from one Go source file.
type LSPActionInfo ¶
type LSPActionInfo struct {
Name string `json:"name"`
Method string `json:"method,omitempty"`
Aliases []string `json:"aliases,omitempty"`
RequiresDocument bool `json:"requires_document"`
RequiresPosition bool `json:"requires_position"`
Description string `json:"description,omitempty"`
}
LSPActionInfo describes a supported high-level language-server action.
func SupportedLSPActions ¶
func SupportedLSPActions() []LSPActionInfo
SupportedLSPActions returns supported LSP actions and aliases.
type LSPCandidate ¶
type LSPCandidate struct {
Language string `json:"language"`
Command string `json:"command"`
Args []string `json:"args,omitempty"`
Installed bool `json:"installed"`
Path string `json:"path,omitempty"`
Description string `json:"description,omitempty"`
}
LSPCandidate describes a language-server command Codog can discover.
func DefaultLSPCandidates ¶
func DefaultLSPCandidates() []LSPCandidate
DefaultLSPCandidates returns common language-server commands and install state.
type LSPCodeDescription ¶
type LSPCodeDescription struct {
Href string `json:"href"`
}
LSPCodeDescription links a diagnostic code to external documentation.
type LSPColor ¶
type LSPColor struct {
Red float64 `json:"red"`
Green float64 `json:"green"`
Blue float64 `json:"blue"`
Alpha float64 `json:"alpha"`
}
LSPColor is the language-server color representation.
type LSPDiagnostic ¶
type LSPDiagnostic struct {
Range LSPRange `json:"range"`
Severity int `json:"severity,omitempty"`
Code any `json:"code,omitempty"`
CodeDescription *LSPCodeDescription `json:"codeDescription,omitempty"`
Source string `json:"source,omitempty"`
Message string `json:"message"`
Tags []int `json:"tags,omitempty"`
RelatedInformation []LSPDiagnosticRelatedInformation `json:"relatedInformation,omitempty"`
Data any `json:"data,omitempty"`
}
LSPDiagnostic describes a language-server diagnostic entry.
type LSPDiagnosticRelatedInformation ¶
type LSPDiagnosticRelatedInformation struct {
Location LSPLocation `json:"location"`
Message string `json:"message"`
}
LSPDiagnosticRelatedInformation explains another location related to a diagnostic.
type LSPFileEdit ¶
type LSPFileEdit struct {
Path string `json:"path"`
AbsPath string `json:"-"`
ActionTitle string `json:"action_title,omitempty"`
ActionKind string `json:"action_kind,omitempty"`
TextEdits int `json:"text_edits"`
Changed bool `json:"changed"`
Content string `json:"content,omitempty"`
}
LSPFileEdit previews the text edits a language server returned for one file.
type LSPLocation ¶
LSPLocation describes a range within a language-server document URI.
type LSPNotification ¶
LSPNotification records a language-server notification emitted while a query was running.
type LSPPosition ¶
LSPPosition is a zero-based language-server document position.
type LSPQueryRequest ¶
type LSPQueryRequest struct {
Action string `json:"action"`
Path string `json:"path"`
Query string `json:"query,omitempty"`
Arguments []any `json:"arguments,omitempty"`
Line int `json:"line,omitempty"`
Character int `json:"character,omitempty"`
NewName string `json:"new_name,omitempty"`
CodeActionTitle string `json:"code_action_title,omitempty"`
Apply bool `json:"apply,omitempty"`
}
LSPQueryRequest describes one language-server query against a document.
type LSPQueryResult ¶
type LSPQueryResult struct {
Kind string `json:"kind"`
Language string `json:"language"`
Action string `json:"action"`
Method string `json:"method"`
Path string `json:"path"`
Result any `json:"result,omitempty"`
Notifications []LSPNotification `json:"notifications,omitempty"`
Diagnostics []LSPDiagnostic `json:"diagnostics,omitempty"`
TextEdits int `json:"text_edits,omitempty"`
FileEdits int `json:"file_edits,omitempty"`
Edits []LSPFileEdit `json:"edits,omitempty"`
Changed bool `json:"changed,omitempty"`
Applied bool `json:"applied,omitempty"`
Content string `json:"content,omitempty"`
}
LSPQueryResult is the normalized result of an LSP JSON-RPC request.
type LSPRange ¶
type LSPRange struct {
Start LSPPosition `json:"start"`
End LSPPosition `json:"end"`
}
LSPRange is a zero-based language-server document range.
type LSPServer ¶
type LSPServer struct {
Language string `json:"language"`
Command string `json:"command"`
TaskID string `json:"task_id"`
Workspace string `json:"workspace"`
StartedAt time.Time `json:"started_at"`
}
LSPServer records a configured background language-server process.
type LSPServerStatus ¶
type LSPServerStatus struct {
LSPServer
Task background.Task `json:"task"`
}
LSPServerStatus combines persisted server metadata with task state.
type LSPStore ¶
LSPStore persists language-server metadata under the Codog config home.
func NewLSPStore ¶
NewLSPStore returns a store for workspace language-server metadata.
func (LSPStore) List ¶
func (s LSPStore) List() ([]LSPServerStatus, error)
List returns all persisted language-server statuses.
func (LSPStore) Query ¶
func (s LSPStore) Query(ctx context.Context, language string, request LSPQueryRequest) (LSPQueryResult, error)
Query starts a configured stdio LSP command and runs one document query.
func (LSPStore) Start ¶
func (s LSPStore) Start(language string, commandArgs []string) (LSPServerStatus, error)
Start launches and records a background language server for a language.
type LinkedEditingRange ¶
type LinkedEditingRange struct {
Path string `json:"path"`
Ranges []LSPRange `json:"ranges"`
WordPattern string `json:"wordPattern,omitempty"`
}
LinkedEditingRange describes ranges that should be edited together.
func LinkedEditingRanges ¶
func LinkedEditingRanges(workspace string, symbol string, relPath string, limit int) (LinkedEditingRange, error)
LinkedEditingRanges returns same-document symbol ranges that can be edited together.
type MapEntry ¶
type MapEntry struct {
Path string `json:"path"`
Type string `json:"type"`
Depth int `json:"depth"`
}
MapEntry describes one file or directory in a workspace code map.
type Moniker ¶
type Moniker struct {
Scheme string `json:"scheme"`
Identifier string `json:"identifier"`
Kind string `json:"kind,omitempty"`
Unique string `json:"unique,omitempty"`
}
Moniker identifies a symbol across files and tools.
type Notebook ¶
type Notebook struct {
Cells []NotebookCell `json:"cells"`
}
Notebook contains the cells from a Jupyter notebook document.
type NotebookCell ¶
NotebookCell contains the source for one notebook cell.
type NotebookEditOptions ¶
NotebookEditOptions describes a notebook cell edit operation.
type NotebookEditResult ¶
type NotebookEditResult struct {
Kind string `json:"kind"`
Path string `json:"path"`
Mode string `json:"mode"`
Index int `json:"index"`
CellID string `json:"cell_id,omitempty"`
CellType string `json:"cell_type,omitempty"`
Language string `json:"language,omitempty"`
CellCount int `json:"cell_count"`
SourceLines int `json:"source_lines,omitempty"`
}
NotebookEditResult reports the applied notebook cell edit.
func EditNotebook ¶
func EditNotebook(path string, options NotebookEditOptions) (NotebookEditResult, error)
EditNotebook applies a replace, insert, or delete operation to a notebook.
type NotebookReadCell ¶
type NotebookReadCell struct {
Index int `json:"index"`
CellID string `json:"cell_id,omitempty"`
CellType string `json:"cell_type"`
Source string `json:"source"`
ExecutionCount any `json:"execution_count,omitempty"`
OutputCount int `json:"output_count,omitempty"`
Outputs any `json:"outputs,omitempty"`
}
NotebookReadCell is a JSON-safe view of one notebook cell.
type NotebookReadOptions ¶
NotebookReadOptions controls notebook read filtering and output expansion.
type NotebookReadResult ¶
type NotebookReadResult struct {
Kind string `json:"kind"`
Path string `json:"path"`
Language string `json:"language,omitempty"`
CellCount int `json:"cell_count"`
Cells []NotebookReadCell `json:"cells"`
Truncated bool `json:"truncated"`
}
NotebookReadResult reports notebook metadata and selected cells.
func ReadNotebook ¶
func ReadNotebook(path string, options NotebookReadOptions) (NotebookReadResult, error)
ReadNotebook reads selected cells from a Jupyter notebook file.
type OrganizeImportsResult ¶
type OrganizeImportsResult struct {
FormatResult
ImportCount int `json:"import_count"`
RemovedImports []string `json:"removed_imports,omitempty"`
DuplicateImports []string `json:"duplicate_imports,omitempty"`
MissingImportInference bool `json:"missing_import_inference"`
MissingImportInferenceNote string `json:"missing_import_inference_note,omitempty"`
}
OrganizeImportsResult reports the result of static Go import organization.
func OrganizeGoImports ¶
func OrganizeGoImports(workspace string, requested string, write bool) (OrganizeImportsResult, error)
OrganizeGoImports removes unused and duplicate Go imports, sorts import declarations, formats the file, and optionally writes the organized content.
type Reference ¶
type Reference struct {
Symbol string `json:"symbol"`
Path string `json:"path"`
Line int `json:"line"`
Text string `json:"text"`
}
Reference describes one textual symbol reference in a Go source file.
type RenameFileEdit ¶
type RenameFileEdit struct {
Path string `json:"path"`
TextEdits int `json:"textEdits"`
Changed bool `json:"changed"`
Content string `json:"content,omitempty"`
Edits []RenameTextEdit `json:"edits,omitempty"`
}
RenameFileEdit previews all rename edits for one file.
type RenamePrepareResult ¶
type RenamePrepareResult struct {
Path string `json:"path,omitempty"`
Symbol string `json:"symbol,omitempty"`
Found bool `json:"found"`
CurrentName string `json:"current_name,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
Range LSPRange `json:"range,omitempty"`
}
RenamePrepareResult describes whether a symbol can be renamed.
func PrepareRenameAtPosition ¶
func PrepareRenameAtPosition(workspace string, relPath string, line int, character int) (RenamePrepareResult, error)
PrepareRenameAtPosition returns the rename range for a symbol at a document position.
type RenameResult ¶
type RenameResult struct {
Symbol string `json:"symbol"`
NewName string `json:"newName"`
Found bool `json:"found"`
TextEdits int `json:"textEdits"`
FileEdits int `json:"fileEdits"`
Edits []RenameFileEdit `json:"edits,omitempty"`
}
RenameResult previews a static workspace rename.
func RenameSymbol ¶
RenameSymbol returns a static workspace rename preview for a Go identifier.
type RenameTextEdit ¶
RenameTextEdit describes one static rename text edit.
type ResolvedSymbol ¶
ResolvedSymbol combines a workspace symbol match with hover context.
func ResolveWorkspaceSymbol ¶
func ResolveWorkspaceSymbol(workspace string, query string) (ResolvedSymbol, bool, error)
ResolveWorkspaceSymbol returns the best static match for a workspace symbol query and includes nearby source context.
type SelectionRange ¶
type SelectionRange struct {
Path string `json:"path"`
Range LSPRange `json:"range"`
Kind string `json:"kind,omitempty"`
}
SelectionRange describes one static AST range containing a document position.
func SelectionRanges ¶
func SelectionRanges(workspace string, relPath string, line int, character int, limit int) ([]SelectionRange, error)
SelectionRanges returns nested static AST ranges containing a document position.
type SemanticToken ¶
type SemanticToken struct {
Path string `json:"path"`
Range LSPRange `json:"range"`
Text string `json:"text"`
Type string `json:"type"`
TokenType int `json:"tokenType"`
}
SemanticToken describes one decoded semantic token.
type SemanticTokens ¶
type SemanticTokens struct {
Path string `json:"path"`
ResultID string `json:"resultId,omitempty"`
Legend []string `json:"legend"`
Data []int `json:"data"`
Tokens []SemanticToken `json:"tokens"`
}
SemanticTokens describes static semantic tokens for a document.
func SemanticTokensForDocument ¶
func SemanticTokensForDocument(workspace string, relPath string, limit int) (SemanticTokens, error)
SemanticTokensForDocument returns static semantic tokens for one source document.
func SemanticTokensForLine ¶
func SemanticTokensForLine(workspace string, relPath string, line int, limit int) (SemanticTokens, error)
SemanticTokensForLine returns static semantic tokens for one document line.
type SemanticTokensDelta ¶
type SemanticTokensDelta struct {
Path string `json:"path"`
PreviousResultID string `json:"previousResultId,omitempty"`
ResultID string `json:"resultId"`
Edits []any `json:"edits"`
Tokens SemanticTokens `json:"tokens"`
}
SemanticTokensDelta describes a static semantic tokens delta response.
func SemanticTokensDeltaForDocument ¶
func SemanticTokensDeltaForDocument(workspace string, relPath string, previousResultID string, limit int) (SemanticTokensDelta, error)
SemanticTokensDeltaForDocument returns a deterministic static delta response.
type Signature ¶
type Signature struct {
Label string `json:"label"`
Documentation string `json:"documentation,omitempty"`
Parameters []SignatureArgument `json:"parameters,omitempty"`
}
Signature describes one static function signature.
type SignatureArgument ¶
type SignatureArgument struct {
Label string `json:"label"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
}
SignatureArgument describes one function parameter.
type SignatureHelp ¶
type SignatureHelp struct {
Path string `json:"path"`
Function string `json:"function"`
Found bool `json:"found"`
Signatures []Signature `json:"signatures,omitempty"`
ActiveSignature int `json:"activeSignature"`
ActiveParameter int `json:"activeParameter"`
CallRange LSPRange `json:"callRange,omitempty"`
Parameters []SignatureArgument `json:"parameters,omitempty"`
}
SignatureHelp describes static function call signature context.
func SignatureHelpAtPosition ¶
func SignatureHelpAtPosition(workspace string, relPath string, line int, character int) (SignatureHelp, error)
SignatureHelpAtPosition returns static signature help for the function call containing a document position.
type Symbol ¶
type Symbol struct {
Name string `json:"name"`
Kind string `json:"kind"`
Path string `json:"path"`
Line int `json:"line"`
}
Symbol describes a Go declaration discovered in the workspace.
func Definition ¶
Definition returns the first discovered definition for a Go symbol.
type TypeHierarchyItem ¶
type TypeHierarchyItem struct {
Name string `json:"name"`
Kind string `json:"kind"`
Path string `json:"path"`
Range LSPRange `json:"range"`
SelectionRange LSPRange `json:"selectionRange"`
Detail string `json:"detail,omitempty"`
}
TypeHierarchyItem describes a static type hierarchy node.
func PrepareTypeHierarchy ¶
func PrepareTypeHierarchy(workspace string, symbol string, relPath string, line int, character int) ([]TypeHierarchyItem, error)
PrepareTypeHierarchy returns the static type hierarchy item for a symbol or document position.
func TypeHierarchySubtypes ¶
func TypeHierarchySubtypes(workspace string, symbol string, limit int) ([]TypeHierarchyItem, error)
TypeHierarchySubtypes returns static subtypes for a Go type. Structs that embed the target type and types that satisfy a target interface's method set are reported as children.
func TypeHierarchySupertypes ¶
func TypeHierarchySupertypes(workspace string, symbol string, limit int) ([]TypeHierarchyItem, error)
TypeHierarchySupertypes returns static supertypes for a Go type. Struct embedding and embedded interfaces are treated as hierarchy parents.