mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Initial commit of Python queries and QL libraries.
This commit is contained in:
committed by
Mark Shannon
parent
90c75cd362
commit
5f58824d1b
17
python/ql/src/analysis/Definitions.ql
Normal file
17
python/ql/src/analysis/Definitions.ql
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @name Definitions
|
||||
* @description Jump to definition helper query.
|
||||
* @kind definitions
|
||||
* @id py/jump-to-definition
|
||||
*/
|
||||
|
||||
import python
|
||||
import DefinitionTracking
|
||||
|
||||
|
||||
from NiceLocationExpr use, Definition defn, string kind, string f, int l
|
||||
where defn = getUniqueDefinition(use) and kind = "Definition"
|
||||
and use.hasLocationInfo(f, l, _, _, _) and
|
||||
// Ignore if the definition is on the same line as the use
|
||||
not defn.getLocation().hasLocationInfo(f, l, _, _, _)
|
||||
select use, defn, kind
|
||||
Reference in New Issue
Block a user