@@ -20,21 +20,27 @@ private string getLocationFilePath(@location_default loc) {
2020 */
2121overlay [ local]
2222private string getSingleLocationFilePath ( @element e ) {
23- // @var_decl has a direct location in the var_decls relation
24- exists ( @location_default loc | var_decls ( e , _, _, _, loc ) | result = getLocationFilePath ( loc ) )
25- //TODO: add other kinds of elements with single locations
23+ exists ( @location_default loc |
24+ var_decls ( e , _, _, _, loc )
25+ or
26+ fun_decls ( e , _, _, _, loc )
27+ |
28+ result = getLocationFilePath ( loc )
29+ )
2630}
2731
2832/**
2933 * Gets the file path for an element with potentially multiple locations.
3034 */
3135overlay [ local]
3236private string getMultiLocationFilePath ( @element e ) {
33- // @variable gets its location(s) from its @var_decl(s)
34- exists ( @var_decl vd , @location_default loc | var_decls ( vd , e , _, _, loc ) |
37+ exists ( @location_default loc |
38+ exists ( @var_decl vd | var_decls ( vd , e , _, _, loc ) )
39+ or
40+ exists ( @fun_decl fd | fun_decls ( fd , e , _, _, loc ) )
41+ |
3542 result = getLocationFilePath ( loc )
3643 )
37- //TODO: add other kinds of elements with multiple locations
3844}
3945
4046/**
0 commit comments