mirror of
https://github.com/github/codeql.git
synced 2026-01-31 07:12:57 +01:00
This is similar to the cpp query for printing the AST in the context of VS Code. This PR also includes a small refactoring to extract the `getEncodedFile` predicate to a new `qll` file.
18 lines
498 B
Plaintext
18 lines
498 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 go/ide-jump-to-definition
|
|
* @tags ide-contextual-queries/local-definitions
|
|
*/
|
|
|
|
import go
|
|
import ideContextual
|
|
|
|
external string selectedSourceFile();
|
|
|
|
from Ident def, Ident use, Entity e
|
|
where use.uses(e) and def.declares(e) and use.getFile() = getEncodedFile(selectedSourceFile())
|
|
select use, def, "V"
|