Skip to content

feat(tools): add symbol_document navigation tool #13

@CalvinAllen

Description

@CalvinAllen

Summary

Add a new MCP tool symbol_document that extracts all symbols (classes, methods, properties, fields, etc.) from a document using EnvDTE FileCodeModel.

Details

  • Returns hierarchical list where classes contain their members
  • Maps vsCMElement kinds to a new SymbolKind enum
  • Input: file path
  • Output: List<SymbolInfo> with name, kind, location, children

Implementation Tasks

  • Create Shared/Models/SymbolModels.cs with SymbolKind enum, SymbolInfo, LocationInfo, WorkspaceSymbolResult, DefinitionResult, ReferencesResult DTOs
  • Add GetDocumentSymbolsAsync(string path) to IVisualStudioRpc in RpcContracts.cs
  • Add GetDocumentSymbolsAsync to IVisualStudioService.cs
  • Implement GetDocumentSymbolsAsync in VisualStudioService.cs using FileCodeModel
  • Add helper method MapElementKind(vsCMElement) for enum conversion
  • Add helper method ConvertCodeElement(CodeElement, string) for recursive extraction
  • Add forwarding method in RpcServer.cs
  • Add proxy method in RpcClient.cs
  • Create Server/Tools/NavigationTools.cs with symbol_document tool
  • Add NavigationTools to tool discovery in RpcClient.GetAvailableToolsAsync()
  • Build and verify no errors

Notes

This is Phase 1 of the LSP-style navigation tools feature. Establishes the FileCodeModel pattern and creates shared DTOs used by subsequent tools.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions