File tree Expand file tree Collapse file tree 4 files changed +4845
-0
lines changed
test/library-tests/taint/general Expand file tree Collapse file tree 4 files changed +4845
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * @name Print AST
3+ * @description Outputs a representation of a file's Abstract Syntax Tree. This
4+ * query is used by the VS Code extension.
5+ * @id py/print-ast
6+ * @kind graph
7+ * @tags ide-contextual-queries/print-ast
8+ */
9+
10+ import python
11+ import semmle.python.PrintAst
12+ import analysis.DefinitionTracking
13+
14+ /**
15+ * The source file to generate an AST from.
16+ */
17+ external string selectedSourceFile ( ) ;
18+
19+ class PrintAstConfigurationOverride extends PrintAstConfiguration {
20+ /**
21+ * Holds if the location matches the selected file in the VS Code extension and
22+ * the element is not a synthetic constructor.
23+ */
24+ override predicate shouldPrint ( AstNode e , Location l ) {
25+ super .shouldPrint ( e , l ) and
26+ l .getFile ( ) = getEncodedFile ( selectedSourceFile ( ) )
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments