11import python
22
33/** A file */
4- class File extends Container {
5- File ( ) { files ( this , _, _, _, _) }
6-
4+ class File extends Container , @file {
75 /** DEPRECATED: Use `getAbsolutePath` instead. */
86 deprecated override string getName ( ) { result = this .getAbsolutePath ( ) }
97
@@ -34,9 +32,7 @@ class File extends Container {
3432 }
3533
3634 /** Gets a short name for this file (just the file name) */
37- string getShortName ( ) {
38- exists ( string simple , string ext | files ( this , _, simple , ext , _) | result = simple + ext )
39- }
35+ string getShortName ( ) { result = this .getBaseName ( ) }
4036
4137 private int lastLine ( ) {
4238 result = max ( int i | exists ( Location l | l .getFile ( ) = this and l .getEndLine ( ) = i ) )
@@ -55,7 +51,7 @@ class File extends Container {
5551 )
5652 }
5753
58- override string getAbsolutePath ( ) { files ( this , result , _ , _ , _ ) }
54+ override string getAbsolutePath ( ) { files ( this , result ) }
5955
6056 /** Gets the URL of this file. */
6157 override string getURL ( ) { result = "file://" + this .getAbsolutePath ( ) + ":0:0:0:0" }
@@ -118,15 +114,10 @@ private predicate occupied_line(File f, int n) {
118114}
119115
120116/** A folder (directory) */
121- class Folder extends Container {
122- Folder ( ) { folders ( this , _, _) }
123-
117+ class Folder extends Container , @folder {
124118 /** DEPRECATED: Use `getAbsolutePath` instead. */
125119 deprecated override string getName ( ) { result = this .getAbsolutePath ( ) }
126120
127- /** DEPRECATED: Use `getBaseName` instead. */
128- deprecated string getSimple ( ) { folders ( this , _, result ) }
129-
130121 /**
131122 * Holds if this element is at the specified location.
132123 * The location spans column `startcolumn` of line `startline` to
@@ -144,7 +135,7 @@ class Folder extends Container {
144135 endcolumn = 0
145136 }
146137
147- override string getAbsolutePath ( ) { folders ( this , result , _ ) }
138+ override string getAbsolutePath ( ) { folders ( this , result ) }
148139
149140 /** Gets the URL of this folder. */
150141 override string getURL ( ) { result = "folder://" + this .getAbsolutePath ( ) }
0 commit comments