We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e197b5 commit 5374440Copy full SHA for 5374440
1 file changed
rust/ql/lib/ide-contextual-queries/localDefinitions.ql
@@ -0,0 +1,23 @@
1
+/**
2
+ * @name Jump-to-definition links
3
+ * @description Generates use-definition pairs that provide the data
4
+ * for jump-to-definition in the code viewer.
5
+ * @kind definitions
6
+ * @id rus/ide-jump-to-definition
7
+ * @tags ide-contextual-queries/local-definitions
8
+ */
9
+
10
+import codeql.IDEContextual
11
+import codeql.rust.elements.Variable
12
+import codeql.rust.elements.Locatable
13
14
+external string selectedSourceFile();
15
16
+predicate localVariable(Locatable e, Variable def) { e = def.getAnAccess() }
17
18
+from Locatable e, Variable def, string kind
19
+where
20
+ e.getLocation().getFile() = getFileBySourceArchiveName(selectedSourceFile()) and
21
+ localVariable(e, def) and
22
+ kind = "local variable"
23
+select e, def, kind
0 commit comments