Merge pull request #19 from github/locations

Fix location handling to match common db schema requirements
This commit is contained in:
Nick Rolfe
2020-10-30 16:56:34 +00:00
committed by GitHub
7 changed files with 402 additions and 46 deletions

View File

@@ -3,13 +3,22 @@
* Automatically generated from the tree-sitter grammar; do not edit
*/
class File extends @file {
string getAbsolutePath() { files(this, result, _, _, _) }
string toString() { result = this.getAbsolutePath() }
}
class Location extends @location {
string toString() { result = "Location" }
predicate hasLocationInfo(
string filePath, int startLine, int startColumn, int endLine, int endColumn
) {
location(this, filePath, startLine, startColumn, endLine, endColumn)
exists(File f |
locations_default(this, f, startLine, startColumn, endLine, endColumn) and
filePath = f.getAbsolutePath()
)
}
}