lsp

package
v1.1.72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hover

func Hover(ctx context.Context, workspace, path string, pos Position) (string, error)

Types

type CallHierarchyCall added in v1.1.45

type CallHierarchyCall struct {
	From       CallHierarchyItem
	To         CallHierarchyItem // only populated for outgoing calls
	FromRanges []Range
}

CallHierarchyCall represents a caller or callee in the call hierarchy.

func IncomingCalls added in v1.1.45

func IncomingCalls(ctx context.Context, workspace string, item CallHierarchyItem) ([]CallHierarchyCall, error)

IncomingCalls returns callers of the given call hierarchy item. Uses item.Path to re-acquire the LSP session for the file's language.

func OutgoingCalls added in v1.1.45

func OutgoingCalls(ctx context.Context, workspace string, item CallHierarchyItem) ([]CallHierarchyCall, error)

OutgoingCalls returns callees of the given call hierarchy item.

type CallHierarchyItem added in v1.1.45

type CallHierarchyItem struct {
	Name   string
	Kind   int
	Detail string
	Path   string
	Range  Range
	// contains filtered or unexported fields
}

CallHierarchyItem represents a call hierarchy item returned by the LSP server.

func PrepareCallHierarchy added in v1.1.45

func PrepareCallHierarchy(ctx context.Context, workspace, path string, pos Position) ([]CallHierarchyItem, error)

PrepareCallHierarchy prepares call hierarchy items for the symbol at pos.

type CodeAction

type CodeAction struct {
	Title   string
	Kind    string
	Command string
	Edits   []FileEdit
}

func CodeActions

func CodeActions(ctx context.Context, workspace, path string, rng Range) ([]CodeAction, error)

type Diagnostic

type Diagnostic struct {
	Severity int
	Message  string
	Range    Range
	Source   string
}

func Diagnostics

func Diagnostics(ctx context.Context, workspace, path string) ([]Diagnostic, error)

type FileEdit

type FileEdit struct {
	Path  string
	Edits []TextEdit
}

func RenameEdits

func RenameEdits(ctx context.Context, workspace, path string, pos Position, newName string) ([]FileEdit, error)

type InstallOption added in v1.1.26

type InstallOption struct {
	ID          string
	Label       string
	Binary      string
	Command     string
	Recommended bool
}

type LanguageStatus

type LanguageStatus struct {
	ID             string
	DisplayName    string
	Available      bool
	Binary         string
	InstallHint    string
	InstallOptions []InstallOption
	Evidence       []string
}

type Location

type Location struct {
	Path  string
	Range Range
}

func Definition

func Definition(ctx context.Context, workspace, path string, pos Position) ([]Location, error)

func Implementation added in v1.1.45

func Implementation(ctx context.Context, workspace, path string, pos Position) ([]Location, error)

Implementation finds implementations of the symbol at pos using textDocument/implementation.

func References

func References(ctx context.Context, workspace, path string, pos Position) ([]Location, error)

type Position

type Position struct {
	Line      int
	Character int
}

type Range

type Range struct {
	Start Position
	End   Position
}

type ResolvedServer

type ResolvedServer struct {
	LanguageID  string
	DisplayName string
	Binary      string
	Args        []string
	InstallHint string
}

func ResolveServerForFile

func ResolveServerForFile(workspace, path string) (ResolvedServer, bool)

func ResolveServerForWorkspace

func ResolveServerForWorkspace(workspace string) (ResolvedServer, bool)

type Symbol

type Symbol struct {
	Name string
	Kind int
	Range
}

func DocumentSymbols

func DocumentSymbols(ctx context.Context, workspace, path string) ([]Symbol, error)

type TextEdit

type TextEdit struct {
	Range   Range
	NewText string
}

type WorkspaceStatus

type WorkspaceStatus struct {
	Workspace string
	Languages []LanguageStatus
}

func DetectWorkspaceStatus

func DetectWorkspaceStatus(workspace string) WorkspaceStatus

type WorkspaceSymbol

type WorkspaceSymbol struct {
	Name string
	Kind int
	Path string
	Range
}

func WorkspaceSymbols

func WorkspaceSymbols(ctx context.Context, workspace, query string) ([]WorkspaceSymbol, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL