Add unified jump-to-definition query - #22358
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3aaa555d-064b-443a-bc65-61a1b99dd0ad
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3aaa555d-064b-443a-bc65-61a1b99dd0ad
Contributor
There was a problem hiding this comment.
Pull request overview
Adds unified jump-to-definition support using the existing static name-binding graph.
Changes:
- Adds the definitions API and contextual query.
- Adds Swift inline-expectation coverage.
- Extracts reusable declaration-naming test utilities.
Show a summary per file
| File | Description |
|---|---|
unified/ql/lib/codeql/Definitions.qll |
Defines reference-to-declaration resolution. |
unified/ql/lib/ide-contextual-queries/definitions.ql |
Exposes file-scoped jump-to-definition results. |
unified/ql/lib/utils/test/TestUtils.qll |
Shares declaration naming utilities. |
unified/ql/test/library-tests/definitions/test.ql |
Implements the definitions test query. |
unified/ql/test/library-tests/definitions/test.swift |
Covers supported name-binding scenarios. |
unified/ql/test/library-tests/definitions/test.expected |
Records generated expected results. |
unified/ql/test/library-tests/static-name-binding/test.ql |
Reuses the shared test utility. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 6/7 changed files
- Comments generated: 0
- Review effort level: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unified currently lacks jump-to-definition support in contextual code navigation. This adds a definitions query backed by the existing static name-binding graph so identifier references resolve to their declarations.
The query follows the contextual-query structure used by other languages and limits results to the selected source file. Inline-expectation tests cover local names, inheritance, static members, nested types, and type aliases. Shared declaration naming logic is extracted into a unified test utility and reused by the existing static name-binding test.