Files
codeql/ruby/ql/lib/ide-contextual-queries/localDefinitions.ql
Andrew Eisenberg a3f4d1bf66 Move contextual queries from src to lib
With this change, users are now able to run View AST command in
vscode within vscode workspaces that do not include the core libraries.
The relevant core library only needs to be installed in the package
cache.
2022-06-29 07:51:26 -07:00

21 lines
571 B
Plaintext

/**
* @name Jump-to-definition links
* @description Generates use-definition pairs that provide the data
* for jump-to-definition in the code viewer.
* @kind definitions
* @id rb/ide-jump-to-definition
* @tags ide-contextual-queries/local-definitions
*/
import codeql.IDEContextual
import codeql.ruby.AST
external string selectedSourceFile();
from AstNode e, Variable def, string kind
where
e = def.getAnAccess() and
kind = "local variable" and
e.getLocation().getFile() = getFileBySourceArchiveName(selectedSourceFile())
select e, def, kind