Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR expands the macro-expansion integration tests in QL by adding new predicates and updating expected outputs to catch previously untested macro cases.
- Added three new QL predicates for attribute macro expansions, resolved macro calls, and unexpanded macro calls.
- Updated expected results to include attribute/crate-specific paths and counts.
- Restructured the workspace (renamed the
macroscrate, addedattributes,calls,proc_macros) and updated source archive and diagnostics expectations.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| rust/ql/integration-tests/macro-expansion/test.ql | Added predicates attribute_macros, macro_calls, and unexpanded_macro_calls. |
| rust/ql/integration-tests/macro-expansion/test.expected | Updated expected test sections and paths. |
| rust/ql/integration-tests/macro-expansion/summary.qlref | Removed obsolete summary reference. |
| rust/ql/integration-tests/macro-expansion/summary.expected | Cleared old summary expectations. |
| rust/ql/integration-tests/macro-expansion/source_archive.expected | Added new source files under attributes and calls. |
| rust/ql/integration-tests/macro-expansion/proc_macros/Cargo.toml | Renamed crate from macros to proc_macros. |
| rust/ql/integration-tests/macro-expansion/calls/src/lib.rs | Added several macro calls to test expansion. |
| rust/ql/integration-tests/macro-expansion/attributes/src/lib.rs | Switched to proc_macros::repeat and inline concat! test. |
| rust/ql/integration-tests/macro-expansion/Cargo.toml | Updated workspace members. |
| rust/ql/integration-tests/.gitignore | Added Cargo.lock to ignore. |
Comments suppressed due to low confidence (1)
rust/ql/integration-tests/macro-expansion/test.ql:7
- [nitpick] The predicate name
macro_callsis very generic. Consider renaming it toresolved_macro_callsto clearly distinguish it fromunexpanded_macro_calls.
query predicate macro_calls(MacroCall c, AstNode expansion) {
Contributor
Author
|
I've used this to raise an issue to rust-analyzer: rust-lang/rust-analyzer#19873 |
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.
This highlights 4 classes of macro calls that don't get any expansion from rust-analyzer 0.0.274 onwards (they do on current main).