Files
codeql/csharp/ql/src/localDefinitions.ql
Jason Reed beccdce108 C#: Refactor definitions query, add queries for ide search
This enables jump-to-definition and find-references in the VS Code
extension, for C# source archives.
2020-05-08 07:31:50 -04:00

20 lines
566 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 cs/ide-jump-to-definition
* @tags ide-contextual-queries/local-definitions
*/
import definitions
external string selectedSourceFile();
from Use e, Declaration def, string kind, string filepath
where
def = definitionOf(e, kind) and
e.hasLocationInfo(filepath, _, _, _, _) and
filepath = getEncodedFile(selectedSourceFile()).getAbsolutePath()
select e, def, kind