Documentation
¶
Index ¶
- func ApplyTextEdits(ctx context.Context, client *lsp.Client, filePath string, edits []TextEdit) (string, error)
- func ExecuteCodeLens(ctx context.Context, client *lsp.Client, filePath string, index int) (string, error)
- func ExtractTextFromLocation(loc protocol.Location) (string, error)
- func FindReferences(ctx context.Context, client *lsp.Client, symbolName string) (string, error)
- func FormatLinesWithRanges(lines []string, ranges []LineRange) string
- func GetCodeLens(ctx context.Context, client *lsp.Client, filePath string) (string, error)
- func GetDiagnosticsForFile(ctx context.Context, client *lsp.Client, filePath string, contextLines int, ...) (string, error)
- func GetFullDefinition(ctx context.Context, client *lsp.Client, startLocation protocol.Location) (string, protocol.Location, error)
- func GetHoverInfo(ctx context.Context, client *lsp.Client, filePath string, line, column int) (string, error)
- func GetLineRangesToDisplay(ctx context.Context, client *lsp.Client, locations []protocol.Location, ...) (map[int]bool, error)
- func ReadDefinition(ctx context.Context, client *lsp.Client, symbolName string) (string, error)
- func RenameSymbol(ctx context.Context, client *lsp.Client, filePath string, line, column int, ...) (string, error)
- type LineRange
- type TextEdit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTextEdits ¶
func ExecuteCodeLens ¶ added in v0.0.2
func ExecuteCodeLens(ctx context.Context, client *lsp.Client, filePath string, index int) (string, error)
ExecuteCodeLens executes a specific code lens command from a file.
func FindReferences ¶
func FormatLinesWithRanges ¶ added in v0.0.6
FormatLinesWithRanges formats file content using line ranges
func GetCodeLens ¶ added in v0.0.2
GetCodeLens retrieves code lens hints for a given file location
func GetDiagnosticsForFile ¶
func GetDiagnosticsForFile(ctx context.Context, client *lsp.Client, filePath string, contextLines int, showLineNumbers bool) (string, error)
GetDiagnosticsForFile retrieves diagnostics for a specific file from the language server
func GetFullDefinition ¶
func GetFullDefinition(ctx context.Context, client *lsp.Client, startLocation protocol.Location) (string, protocol.Location, error)
Gets the full code block surrounding the start of the input location
func GetHoverInfo ¶ added in v0.0.5
func GetHoverInfo(ctx context.Context, client *lsp.Client, filePath string, line, column int) (string, error)
GetHoverInfo retrieves hover information (type, documentation) for a symbol at the specified position
func GetLineRangesToDisplay ¶ added in v0.0.6
func GetLineRangesToDisplay(ctx context.Context, client *lsp.Client, locations []protocol.Location, totalLines int, contextLines int) (map[int]bool, error)
GetLineRangesToDisplay determines which lines should be displayed for a set of locations
func ReadDefinition ¶
func RenameSymbol ¶ added in v0.0.5
func RenameSymbol(ctx context.Context, client *lsp.Client, filePath string, line, column int, newName string) (string, error)
RenameSymbol renames a symbol (variable, function, class, etc.) at the specified position It uses the LSP rename functionality to handle all references across files
Types ¶
type TextEdit ¶
type TextEdit struct { StartLine int `json:"startLine" jsonschema:"required,description=Start line to replace, inclusive"` EndLine int `json:"endLine" jsonschema:"required,description=End line to replace, inclusive"` NewText string `json:"newText" jsonschema:"description=Replacement text. Replace with the new text. Leave blank to remove lines."` }