-
Notifications
You must be signed in to change notification settings - Fork 751
Implementations, CodeLens, IncomingCalls across projects #2235
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements cross-project functionality for "Go to Implementation" and CodeLens features, enabling these features to work across project references in a TypeScript workspace. This addresses issue #2177.
Key changes:
- Refactored multi-project reference handling into a reusable
multiProjectRequestHandlingfunction - Extended implementations and CodeLens resolution to search across project references
- Added
SymbolAndEntriesDatastruct to encapsulate symbol lookup results and support implementation traversal - Moved CodeLens resolution logic from the language service to the server to enable cross-project queries
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
internal/lsp/server.go |
Refactored multi-project handling into shared multiProjectRequestHandling function; moved implementations and CodeLens to use multi-project infrastructure; moved CodeLens resolution from LS to server |
internal/ls/findallreferences.go |
Updated ProvideSymbolsAndEntries to support implementations with queue-based traversal; introduced SymbolAndEntriesData and SymbolEntryTransformOptions types |
internal/ls/codelens.go |
Removed ResolveCodeLens method (moved to server) |
internal/lsp/lsproto/lsp.go |
Added HasLocations and HasLocation interfaces for generic location handling |
internal/lsp/lsproto/lsp_generated.go |
Added GetLocation() and GetLocations() methods to protocol types |
internal/lsp/lsproto/_generate/generate.mts |
Updated code generator to automatically generate GetLocation() and GetLocations() methods |
internal/project/untitled_test.go |
Updated test calls to use new ProvideSymbolsAndEntries API |
internal/fourslash/tests/stateimplementations_test.go |
Added test for implementations across project references |
internal/fourslash/tests/statecodelens_test.go |
Added tests for CodeLens across project references |
testdata/baselines/reference/fourslash/state/implementationsAncestorProjectRefMangement.baseline |
New baseline for implementations test |
testdata/baselines/reference/fourslash/state/codeLensAcrossProjects.baseline |
New baseline for CodeLens across projects test |
testdata/baselines/reference/fourslash/codeLenses/codeLensOnFunctionAcrossProjects1.baseline.jsonc |
New baseline for function CodeLens across projects |
| forOriginalLocation bool | ||
| } | ||
|
|
||
| type CrossProjectOrchestrator interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming suggestions welcome
|
Failure is because of not correctly calling recover to assign request for panic. will take a look . |
Fixes #2177