Swift: Add Location.toString.

This commit is contained in:
Geoffrey White
2022-10-17 11:55:47 +01:00
parent 4d0c23c4da
commit 9c8bbe384b
2 changed files with 15 additions and 4 deletions

View File

@@ -8,4 +8,15 @@ class Location extends LocationBase {
el = getEndLine() and
ec = getEndColumn()
}
/**
* Gets a textual representation of this location.
*/
override string toString() {
exists(string filePath, int startLine, int startColumn, int endLine, int endColumn |
this.hasLocationInfo(filePath, startLine, startColumn, endLine, endColumn)
|
toUrl(filePath, startLine, startColumn, endLine, endColumn, result)
)
}
}

View File

@@ -1,4 +1,4 @@
| file://:0:0:0:0 | UnknownLocation |
| location.swift:2:1:3:1 | DbLocation |
| location.swift:2:11:2:14 | DbLocation |
| location.swift:2:19:3:1 | DbLocation |
| file://:0:0:0:0 | file://:0:0:0:0 |
| location.swift:2:1:3:1 | location.swift:2:1:3:1 |
| location.swift:2:11:2:14 | location.swift:2:11:2:14 |
| location.swift:2:19:3:1 | location.swift:2:19:3:1 |