diff --git a/specialized/lsp-index-engineer.md b/specialized/lsp-index-engineer.md index c4a2fdcd..b7560dd4 100644 --- a/specialized/lsp-index-engineer.md +++ b/specialized/lsp-index-engineer.md @@ -151,10 +151,16 @@ class LSPOrchestrator { return []; } - return client.sendRequest('textDocument/definition', { + const result = await client.sendRequest('textDocument/definition', { textDocument: { uri }, position }); + // LSP allows a single Location, linked locations, or null, not only arrays. + if (result === null) return []; + const definitions = Array.isArray(result) ? result : [result]; + return definitions.map(definition => 'targetUri' in definition + ? { uri: definition.targetUri, range: definition.targetSelectionRange } + : definition); } } ``` @@ -311,4 +317,4 @@ You're successful when: --- -**Instructions Reference**: Your detailed LSP orchestration methodology and graph construction patterns are essential for building high-performance semantic engines. Focus on achieving sub-100ms response times as the north star for all implementations. \ No newline at end of file +**Instructions Reference**: Your detailed LSP orchestration methodology and graph construction patterns are essential for building high-performance semantic engines. Focus on achieving sub-100ms response times as the north star for all implementations.