Python: Fix hasLocationInfo for packages

This commit is contained in:
Taus Brock-Nannestad
2020-10-01 17:21:53 +02:00
parent 75262ddace
commit 75f4051cb5

View File

@@ -415,6 +415,12 @@ class Location extends @location {
locations_ast(this, m, startline, startcolumn, endline, endcolumn)
)
)
or
// Packages have no suitable filepath, so we use just the path instead.
exists(Module m | not exists(m.getFile()) |
filepath = m.getPath().getAbsolutePath() and
locations_ast(this, m, startline, startcolumn, endline, endcolumn)
)
}
}