mirror of
https://github.com/github/codeql.git
synced 2026-04-19 22:14:01 +02:00
Don't include desugared nodes in the printed AST
The base `PrintAstConfiguration` class already has a predicate for filtering out desugared nodes - this change just makes use of it in the query. This fixes https://github.com/github/codeql-team/issues/408, which was caused by including nodes representing the desugaring of a[b] = c in the query output. This would result in multiple edges to the same target node (one from the surface AST and another from the desugared AST), which the VSCode AST viewer cannot handle.
This commit is contained in:
@@ -21,6 +21,7 @@ external string selectedSourceFile();
|
||||
*/
|
||||
class Cfg extends PrintAstConfiguration {
|
||||
override predicate shouldPrintNode(AstNode n) {
|
||||
super.shouldPrintNode(n) and
|
||||
n.getLocation().getFile() = getFileBySourceArchiveName(selectedSourceFile())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user