MCPcopy Create free account
hub / github.com/diillson/chatcli / Definition

Method Definition

cli/lsp_tool_adapter.go:124–137  ·  view source on GitHub ↗

Definition implements plugins.LSPAdapter. line/column are 1-based.

(file string, line, column int)

Source from the content-addressed store, hash-verified

122
123// Definition implements plugins.LSPAdapter. line/column are 1-based.
124func (a *lspToolAdapter) Definition(file string, line, column int) (string, error) {
125 sess, _, err := a.acquire(file)
126 if err != nil {
127 return "", err
128 }
129 locs, err := sess.Client.Definition(sess.URI, lspPos(line, column))
130 if err != nil {
131 return "", err
132 }
133 if len(locs) == 0 {
134 return "No definition found at that position — check that line/column point at the symbol name (1-based).", nil
135 }
136 return formatLocations("definition", sess.Root, locs, len(locs)), nil
137}
138
139// References implements plugins.LSPAdapter. line/column are 1-based.
140func (a *lspToolAdapter) References(file string, line, column int, includeDeclaration bool, limit int) (string, error) {

Callers

nothing calls this directly

Calls 4

acquireMethod · 0.95
lspPosFunction · 0.85
formatLocationsFunction · 0.85
DefinitionMethod · 0.65

Tested by

no test coverage detected