Summary
textDocument/definition and textDocument/references extract only the token at the cursor and then run global exact symbol/reference queries. Common names such as Run, Build, Handle, or Dispose can therefore return unrelated definitions or references from other files and types.
Evidence
src/CodeIndex/Lsp/LspServer.cs:103 calls ExtractPositionToken and then _reader.GetDefinitions(query, DefaultLimit, exact: true).
src/CodeIndex/Lsp/LspServer.cs:116 calls _reader.AnalyzeSymbol(query, DefaultLimit, exact: true).
src/CodeIndex/Lsp/LspServer.cs:143 resolves the document path only to read the token; the path/container is not carried into the query.
Expected
LSP definition and references should use file, line, and enclosing symbol context when available, or at minimum narrow results to the current indexed file or plausible container before falling back to global exact-name lookup.
Summary
textDocument/definitionandtextDocument/referencesextract only the token at the cursor and then run global exact symbol/reference queries. Common names such asRun,Build,Handle, orDisposecan therefore return unrelated definitions or references from other files and types.Evidence
src/CodeIndex/Lsp/LspServer.cs:103callsExtractPositionTokenand then_reader.GetDefinitions(query, DefaultLimit, exact: true).src/CodeIndex/Lsp/LspServer.cs:116calls_reader.AnalyzeSymbol(query, DefaultLimit, exact: true).src/CodeIndex/Lsp/LspServer.cs:143resolves the document path only to read the token; the path/container is not carried into the query.Expected
LSP definition and references should use file, line, and enclosing symbol context when available, or at minimum narrow results to the current indexed file or plausible container before falling back to global exact-name lookup.