mirror of
https://github.com/msitarzewski/agency-agents.git
synced 2026-10-14 10:07:14 +00:00
Merge #1102: fix(lsp): normalize protocol definition results to locations
This commit is contained in:
@@ -151,10 +151,16 @@ class LSPOrchestrator {
|
||||
return [];
|
||||
}
|
||||
|
||||
return client.sendRequest('textDocument/definition', {
|
||||
const result = await client.sendRequest<Location | Location[] | LocationLink[] | null>('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.
|
||||
**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.
|
||||
|
||||
Reference in New Issue
Block a user