Summary
Wire the existing Call Hierarchy LSP infrastructure to the editor so users can explore incoming and outgoing function calls.
Trigger
- Hotkey:
Shift+Alt+H (VS Code default for "Show Call Hierarchy")
- Alternative: Could use a command palette or context menu
Existing Infrastructure
| Layer |
Location |
Method |
Status |
| LSP Client |
LanguageServerClient.cs |
RequestCallHierarchyPrepareAsync(), RequestCallHierarchyIncomingAsync(), RequestCallHierarchyOutgoingAsync() |
Exists |
| Feature Controller |
LspFeatureController.cs |
All three call hierarchy methods |
Exists |
| Decoration Provider |
LanguageServerDecorationProvider.cs |
All three call hierarchy methods |
Exists |
| Editor Primitive |
IEditorSession.cs |
ShowActionMenuAsync() for list display |
Exists |
| Editor Binding |
EditorNode.cs |
Not bound |
Missing |
Implementation
1. Add Shift+Alt+H binding
bindings.Shift().Alt().Key(Hex1bKey.H).Action(TriggerCallHierarchyAsync, "Show call hierarchy");
2. Add TriggerCallHierarchyAsync method
- Call
provider.RequestCallHierarchyPrepareAsync(line, column) to get the CallHierarchyItem at cursor
- If valid, show an
ActionMenu with two choices: "Incoming Calls" and "Outgoing Calls"
- Based on selection:
- Incoming: Call
RequestCallHierarchyIncomingAsync(item) and display callers
- Outgoing: Call
RequestCallHierarchyOutgoingAsync(item) and display callees
- Display results in an
ActionMenu or EditorOverlay listing each call with file/line info
- Selecting a result navigates to that location (similar to Go to Definition)
3. Navigation on selection
When user selects a call from the list:
- If same file: move cursor to that position
- If different file: could show the file path (cross-file navigation is a future feature)
4. Update README
- Document Shift+Alt+H hotkey
Visual Behavior
- Cursor on
addTask function, press Shift+Alt+H
- Menu appears: "Incoming Calls" / "Outgoing Calls"
- Select "Incoming Calls"
- Overlay shows:
handleSubmit (line 42), processQueue (line 78)
- Select one to navigate there
Tests
- Shift+Alt+H on function shows hierarchy menu
- Incoming calls returns callers
- Outgoing calls returns callees
- Selecting a result navigates to the location
- Invalid cursor position shows nothing
Notes
- TypeScript language server supports call hierarchy
- This is a multi-step interaction (prepare -> choose direction -> browse results)
- Consider a tree view if the results are hierarchical (calls of calls)
Summary
Wire the existing Call Hierarchy LSP infrastructure to the editor so users can explore incoming and outgoing function calls.
Trigger
Shift+Alt+H(VS Code default for "Show Call Hierarchy")Existing Infrastructure
LanguageServerClient.csRequestCallHierarchyPrepareAsync(),RequestCallHierarchyIncomingAsync(),RequestCallHierarchyOutgoingAsync()LspFeatureController.csLanguageServerDecorationProvider.csIEditorSession.csShowActionMenuAsync()for list displayEditorNode.csImplementation
1. Add Shift+Alt+H binding
2. Add
TriggerCallHierarchyAsyncmethodprovider.RequestCallHierarchyPrepareAsync(line, column)to get theCallHierarchyItemat cursorActionMenuwith two choices: "Incoming Calls" and "Outgoing Calls"RequestCallHierarchyIncomingAsync(item)and display callersRequestCallHierarchyOutgoingAsync(item)and display calleesActionMenuorEditorOverlaylisting each call with file/line info3. Navigation on selection
When user selects a call from the list:
4. Update README
Visual Behavior
addTaskfunction, press Shift+Alt+HhandleSubmit (line 42),processQueue (line 78)Tests
Notes