Skip to content

Commit 3a80456

Browse files
committed
fix: Print CFG query
1 parent 0a1c593 commit 3a80456

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

ql/lib/ide-contextual-queries/printCfg.ql

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,40 @@
22
* @name Print CFG
33
* @description Produces a representation of a file's Control Flow Graph.
44
* This query is used by the VS Code extension.
5-
* @id rb/print-cfg
5+
* @id bicep/print-cfg
66
* @kind graph
77
* @tags ide-contextual-queries/print-cfg
88
*/
99

10-
private import codeql.Locations
11-
private import codeql.bicep.controlflow.internal.ControlFlowGraphImpl
12-
private import codeql.bicep.controlflow.ControlFlowGraph
13-
14-
external string selectedSourceFile();
15-
16-
private predicate selectedSourceFileAlias = selectedSourceFile/0;
17-
18-
external int selectedSourceLine();
19-
20-
private predicate selectedSourceLineAlias = selectedSourceLine/0;
21-
22-
external int selectedSourceColumn();
23-
24-
private predicate selectedSourceColumnAlias = selectedSourceColumn/0;
25-
26-
module ViewCfgQueryInput implements ViewCfgQueryInputSig<File> {
27-
predicate selectedSourceFile = selectedSourceFileAlias/0;
28-
29-
predicate selectedSourceLine = selectedSourceLineAlias/0;
30-
31-
predicate selectedSourceColumn = selectedSourceColumnAlias/0;
32-
33-
predicate cfgScopeSpan(
34-
CfgScope scope, File file, int startLine, int startColumn, int endLine, int endColumn
35-
) {
36-
file = scope.getFile() and
37-
scope.getLocation().hasLocationInfo(_, startLine, startColumn, endLine, endColumn)
38-
}
39-
}
40-
41-
import ViewCfgQuery<File, ViewCfgQueryInput>
10+
private import codeql.Locations
11+
private import codeql.bicep.controlflow.internal.ControlFlowGraphImpl
12+
private import codeql.bicep.controlflow.ControlFlowGraph
13+
14+
external string selectedSourceFile();
15+
16+
private predicate selectedSourceFileAlias = selectedSourceFile/0;
17+
18+
external int selectedSourceLine();
19+
20+
private predicate selectedSourceLineAlias = selectedSourceLine/0;
21+
22+
external int selectedSourceColumn();
23+
24+
private predicate selectedSourceColumnAlias = selectedSourceColumn/0;
25+
26+
module ViewCfgQueryInput implements ViewCfgQueryInputSig<File> {
27+
predicate selectedSourceFile = selectedSourceFileAlias/0;
28+
29+
predicate selectedSourceLine = selectedSourceLineAlias/0;
30+
31+
predicate selectedSourceColumn = selectedSourceColumnAlias/0;
32+
33+
predicate cfgScopeSpan(
34+
CfgScope scope, File file, int startLine, int startColumn, int endLine, int endColumn
35+
) {
36+
file = scope.getFile() and
37+
scope.getLocation().hasLocationInfo(_, startLine, startColumn, endLine, endColumn)
38+
}
39+
}
40+
41+
import ViewCfgQuery<File, ViewCfgQueryInput>

0 commit comments

Comments
 (0)