Python: Refactor definitions query, add queries for ide search

This enables jump-to-definition and find-references in the VS Code
extension, for python source archives.
This commit is contained in:
Jason Reed
2020-05-04 10:39:59 -04:00
parent 29a5ea121a
commit b0f72ebb56
5 changed files with 64 additions and 8 deletions

View File

@@ -8,11 +8,6 @@
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
from NiceLocationExpr use, Definition defn, string kind
where defn = definitionOf(use, kind)
select use, defn, kind