-
Notifications
You must be signed in to change notification settings - Fork 42
feat: add new LSP tools with fixes and tests #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add the following new MCP tools to match Claude Code's built-in LSP capabilities: - get_hover: Get hover information (documentation, type info) for a symbol - find_workspace_symbols: Search for symbols across the entire workspace - find_implementation: Find implementations of interfaces/abstract methods - prepare_call_hierarchy: Get call hierarchy item at a position - get_incoming_calls: Find all callers of a function - get_outgoing_calls: Find all functions called by a function Changes: - src/types.ts: Add CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall types - src/lsp-client.ts: Add hover(), workspaceSymbol(), findImplementation(), prepareCallHierarchy(), incomingCalls(), outgoingCalls() methods - index.ts: Add MCP tool definitions and handlers for all new tools
feat: add new LSP tools (hover, workspace_symbol, find_implementation…
Fix Windows path handling in incomingCalls and outgoingCalls methods.
Previously used item.uri.replace('file://', '') which doesn't work
correctly on Windows. Now uses the existing uriToPath utility function
which properly handles both Windows and Unix paths.
…ementation, prepareCallHierarchy, incomingCalls, outgoingCalls) Add comprehensive test coverage for the 6 new LSP methods added in PR #28: - hover: Test hover information retrieval and null handling - workspaceSymbol: Test workspace-wide symbol search with multiple scenarios - findImplementation: Test implementation finding with array and object results - prepareCallHierarchy: Test call hierarchy preparation - incomingCalls: Test incoming calls retrieval (includes uriToPath usage verification) - outgoingCalls: Test outgoing calls retrieval (includes uriToPath usage verification) All tests follow the existing test patterns using mocks for getServer, ensureFileOpen, and sendRequest methods.
Fix formatting issues: - Split long return type definition in hover() method across multiple lines - Format sendRequest calls in workspaceSymbol, incomingCalls, and outgoingCalls to single line
Fix tests to use uriToPath() result instead of hardcoded '/test.ts' path. This ensures tests work correctly across different platforms (Unix/Windows) where uriToPath may return different path formats.
Windows CI FixThe 4 failing tests ( Problem: On Windows, Solution: Replace hardcoded paths with
I've prepared a fix PR below. |
|
Hi @ktnyt! I found this project because Claude Code's official LSP plugin ( The official plugin is also closed-source - I only discovered this by digging through the local plugin directory after installation. So I searched for alternatives and found cclsp, which actually works! I then added the missing LSP features (hover, workspaceSymbol, goToImplementation, prepareCallHierarchy, incomingCalls, outgoingCalls) based on the official LSP documentation. cclsp has clear advantages:
Thanks for reviewing my PR and fixing the bugs! I really appreciate you taking the time to improve the code quality. Happy to continue contributing to this project! |
Windows test failures will no longer block the release job, while Ubuntu and macOS tests continue to block on failure. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
Apologies for my late response. I was trying to get the Windows tests to work with no avail. I'll merge this and try to fix the tests in the future. |
This PR adds 6 new LSP tools from PR #28, plus fixes and comprehensive tests.
Features Added
Adds the following new MCP tools to match Claude Code's built-in LSP capabilities:
get_hover: Get hover information (documentation, type info) for a symbolfind_workspace_symbols: Search for symbols across the entire workspacefind_implementation: Find implementations of interfaces/abstract methodsprepare_call_hierarchy: Get call hierarchy item at a positionget_incoming_calls: Find all callers of a functionget_outgoing_calls: Find all functions called by a functionFixes
incomingCallsandoutgoingCallsto useuriToPathutility instead of string replacement, ensuring proper Windows path handlingTests
Added comprehensive test coverage for all 6 new LSP methods:
hover: Tests hover information retrieval and null handlingworkspaceSymbol: Tests workspace-wide symbol search with multiple scenariosfindImplementation: Tests implementation finding with array and object resultsprepareCallHierarchy: Tests call hierarchy preparationincomingCalls: Tests incoming calls retrieval (includes uriToPath usage verification)outgoingCalls: Tests outgoing calls retrieval (includes uriToPath usage verification)All tests follow existing patterns using mocks for
getServer,ensureFileOpen, andsendRequestmethods.Changes
src/types.ts: Add CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall typessrc/lsp-client.ts: Add 6 new methods + fix Windows path handlingindex.ts: Add MCP tool definitions and handlers for all new toolssrc/lsp-client.test.ts: Add comprehensive test coverage (654 lines)Related