Rust: Add telemetry for comparing against rust-analyzer#19025
Rust: Add telemetry for comparing against rust-analyzer#19025hvitved merged 1 commit intogithub:mainfrom
rust-analyzer#19025Conversation
|
|
||
| predicate same(Source s, Target t) { | ||
| t = RustAnalyzer::resolve(s) and | ||
| t = Ql::resolve(s) |
Check warning
Code scanning / CodeQL
Redundant assignment. Warning
28ea69c to
30da4dd
Compare
30da4dd to
89f6245
Compare
paldepind
left a comment
There was a problem hiding this comment.
A few questions, but LGTM.
| private import codeql.rust.elements.internal.CallExprBaseImpl::Impl as CallExprBaseImpl | ||
|
|
||
| predicate isResolvable(CallExprBase c) { | ||
| CallExprBaseImpl::getCallResolvable(c).hasResolvedPath() |
There was a problem hiding this comment.
Is this different from exists(resolve(c))? If it isn't, isResolvable wouldn't have to be on the signature as it would be exists(resolve(c)) in all cases.
There was a problem hiding this comment.
Good question, there is a subtle difference: Since we don't yet have entities for all dependencies in the DB (such as built-in types), we may reference that can resolve to a canonical path, but where there is no corresponding Item with the same canonical path.
| t1 != t2 | ||
| } | ||
|
|
||
| predicate diffCount(int c) { c = count(Source s | not same(s, _) and diff(s, _, _)) } |
There was a problem hiding this comment.
Why do we exclude those that are in same(s, _) here? If there's overlap I guess it's because one of the resolvers produce several results for a Source.
There was a problem hiding this comment.
We don't want to report cases where our QL implementation resolves to multiple items, and one of them is correct. We have a consistency check for multiple resolutions.
There was a problem hiding this comment.
I see, that makes sense :)
| predicate pathResolutionCompare(string key, int value) { | ||
| exists(string suffix | | ||
| PathResolutionCompare::summary(suffix, value) and | ||
| key = "Rust-analyzer path resolution comparison: " + suffix |
There was a problem hiding this comment.
I guess I would expect the value to come after a :. Maybe , or some other symbol would work better?
There was a problem hiding this comment.
I would rather not change it, since we already have logic in DCA that depends on the exact wording of the string.
|
Thanks for the answers. Let's merge 🎉 |
Adds telemetry data, for use in DCA, for comparing our QL-based implementations of path resolution and static call graph construction against what we get from
rust-analyzer.