Skip to content
This repository was archived by the owner on Apr 10, 2022. It is now read-only.

Commit 44311e2

Browse files
authored
Merge pull request #5 from github/qltest-testing
Get qlTest to work
2 parents f351100 + f916aa9 commit 44311e2

File tree

5 files changed

+528
-5
lines changed

5 files changed

+528
-5
lines changed

ql/src/ide-contextual-queries/localDefinitions.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
*/
99

1010
import codeql.IDEContextual
11-
import codeql_ql.AST
11+
import codeql_ql.ast.internal.TreeSitter::Generated
1212

1313
external string selectedSourceFile();
1414

1515
from AstNode e, Variable def, string kind
1616
where
17-
e = def.getAnAccess() and
17+
none() and // e = def.getAnAccess() and // TODO: Get binding to work.
1818
kind = "local variable" and
1919
e.getLocation().getFile() = getFileBySourceArchiveName(selectedSourceFile())
2020
select e, def, kind

ql/src/ide-contextual-queries/localReferences.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
*/
99

1010
import codeql.IDEContextual
11-
import codeql_ql.AST
12-
import codeql_ql.ast.Variable
11+
import codeql_ql.ast.internal.TreeSitter::Generated
1312

1413
external string selectedSourceFile();
1514

1615
from AstNode e, Variable def, string kind
1716
where
18-
e = def.getAnAccess() and
17+
none() and // e = def.getAnAccess() and // TODO: Get binding to work.
1918
kind = "local variable" and
2019
def.getLocation().getFile() = getFileBySourceArchiveName(selectedSourceFile())
2120
select e, def, kind

ql/test/printAst/Foo.qll

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import javascript
2+
3+
class Foo extends @bar {
4+
Foo() { 1 = 2 }
5+
6+
string toString() { result = "Foo" }
7+
}
8+
9+
query predicate foo(Foo f) {
10+
f = rank[2](Foo inner | inner.toString() = "foo" | inner order by inner.toString())
11+
}

0 commit comments

Comments
 (0)