@@ -19,15 +19,26 @@ module Impl {
1919 final Location getLocation ( ) {
2020 exists ( Raw:: Locatable raw |
2121 raw = Synth:: convertLocatableToRaw ( this ) and
22- (
23- locatable_locations ( raw , result )
24- or
25- not exists ( Location loc | locatable_locations ( raw , loc ) ) and
26- result instanceof EmptyLocation
27- )
22+ locatable_locations ( raw , result )
2823 )
2924 }
3025
26+ /**
27+ * Holds if this element is at the specified location.
28+ * The location spans column `startcolumn` of line `startline` to
29+ * column `endcolumn` of line `endline` in file `filepath`.
30+ * For more information, see
31+ * [Providing locations in CodeQL queries](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
32+ */
33+ predicate hasLocationInfo (
34+ string filepath , int startline , int startcolumn , int endline , int endcolumn
35+ ) {
36+ this .getLocation ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
37+ or
38+ not exists ( this .getLocation ( ) ) and
39+ any ( EmptyLocation e ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
40+ }
41+
3142 /**
3243 * Gets the primary file where this element occurs.
3344 */
0 commit comments