Move python contextual queries to lib folders

This will ensure that python projects can use jump to ref/def in
vscode when the core libraries are not installed.
This commit is contained in:
Andrew Eisenberg
2022-07-15 12:06:41 -07:00
parent d50816a284
commit b897a40228
3 changed files with 5 additions and 0 deletions

View File

@@ -1,20 +0,0 @@
/**
* @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 py/ide-jump-to-definition
* @tags ide-contextual-queries/local-definitions
*/
import python
import analysis.DefinitionTracking
external string selectedSourceFile();
from NiceLocationExpr use, Definition defn, string kind, string f
where
defn = definitionOf(use, kind) and
use.hasLocationInfo(f, _, _, _, _) and
getFileBySourceArchiveName(selectedSourceFile()).getAbsolutePath() = f
select use, defn, kind

View File

@@ -1,19 +0,0 @@
/**
* @name Find-references links
* @description Generates use-definition pairs that provide the data
* for find-references in the code viewer.
* @kind definitions
* @id py/ide-find-references
* @tags ide-contextual-queries/local-references
*/
import python
import analysis.DefinitionTracking
external string selectedSourceFile();
from NiceLocationExpr use, Definition defn, string kind
where
defn = definitionOf(use, kind) and
defn.getLocation().getFile() = getFileBySourceArchiveName(selectedSourceFile())
select use, defn, kind

View File

@@ -0,0 +1,5 @@
---
category: breaking
---
* Contextual queries and the query libraries they depend on have been moved to the `codeql/python-all` package.