@@ -19,8 +19,8 @@ private signature predicate exprSig(Expr e);
1919module ResolveExpr< exprSig / 1 shouldResolveExpr> {
2020 final private class FinalExpr = Expr ;
2121
22- private class RelevantPathExpr extends FinalExpr {
23- RelevantPathExpr ( ) { shouldResolveExpr ( this ) }
22+ private class RelevantExpr extends FinalExpr {
23+ RelevantExpr ( ) { shouldResolveExpr ( this ) }
2424
2525 string getValue ( ) { result = this .getStringValue ( ) }
2626 }
@@ -44,7 +44,7 @@ module ResolveExpr<exprSig/1 shouldResolveExpr> {
4444 * Gets the TSConfig file relevant for resolving `expr`.
4545 */
4646 pragma [ nomagic]
47- private TSConfig getTSConfigFromPathExpr ( RelevantPathExpr expr ) {
47+ private TSConfig getTSConfigFromPathExpr ( RelevantExpr expr ) {
4848 result .getAnIncludedContainer ( ) = expr .getFile ( )
4949 or
5050 result = getFallbackTSConfig ( expr .getFile ( ) )
@@ -62,7 +62,7 @@ module ResolveExpr<exprSig/1 shouldResolveExpr> {
6262 * gets `foo` from `foo/bar`, and `@example/foo` from `@example/foo/bar`.
6363 */
6464 pragma [ nomagic]
65- private string getPackagePrefixFromPathExpr ( RelevantPathExpr expr ) {
65+ private string getPackagePrefixFromPathExpr ( RelevantExpr expr ) {
6666 result = expr .getValue ( ) .regexpFind ( "^(@[^/\\\\]+[/\\\\])?[^@./\\\\][^/\\\\]*" , _, _)
6767 }
6868
@@ -81,7 +81,7 @@ module ResolveExpr<exprSig/1 shouldResolveExpr> {
8181 * Holds if `expr` matches a path mapping, and should thus be resolved as `newPath` relative to `base`.
8282 */
8383 pragma [ nomagic]
84- private predicate resolveViaPathMapping ( RelevantPathExpr expr , Container base , string newPath ) {
84+ private predicate resolveViaPathMapping ( RelevantExpr expr , Container base , string newPath ) {
8585 // Handle tsconfig mappings such as `{ "paths": { "@/*": "./src/*" }}`
8686 exists ( TSConfig config , string value |
8787 config = getTSConfigFromPathExpr ( expr ) .getExtendedTSConfig * ( ) and
@@ -121,8 +121,8 @@ module ResolveExpr<exprSig/1 shouldResolveExpr> {
121121 }
122122
123123 pragma [ noopt]
124- private predicate relativePathExpr ( RelevantPathExpr expr , Container base , string path ) {
125- expr instanceof RelevantPathExpr and
124+ private predicate relativePathExpr ( RelevantExpr expr , Container base , string path ) {
125+ expr instanceof RelevantExpr and
126126 path = expr .getValue ( ) and
127127 isRelativePath ( path ) and
128128 exists ( File file |
@@ -135,7 +135,7 @@ module ResolveExpr<exprSig/1 shouldResolveExpr> {
135135 * Holds if `expr` should be resolved as `path` relative to `base`.
136136 */
137137 pragma [ nomagic]
138- private predicate shouldResolve ( RelevantPathExpr expr , Container base , string path ) {
138+ private predicate shouldResolve ( RelevantExpr expr , Container base , string path ) {
139139 // Relative paths are resolved from their enclosing folder
140140 relativePathExpr ( expr , base , path )
141141 or
@@ -172,21 +172,21 @@ module ResolveExpr<exprSig/1 shouldResolveExpr> {
172172
173173 private module Resolver = Folder:: Resolve< ResolverConfig > ;
174174
175- private Container resolvePathExpr1 ( RelevantPathExpr expr ) {
175+ private Container resolvePathExpr1 ( RelevantExpr expr ) {
176176 exists ( Container base , string path |
177177 shouldResolve ( expr , base , path ) and
178178 result = Resolver:: resolve ( base , path )
179179 )
180180 }
181181
182- File resolveExpr ( RelevantPathExpr expr ) {
182+ File resolveExpr ( RelevantExpr expr ) {
183183 result = resolvePathExpr1 ( expr )
184184 or
185185 result = getFileFromFolderImport ( resolvePathExpr1 ( expr ) )
186186 }
187187
188188 module Debug {
189- class PathExprToDebug extends RelevantPathExpr {
189+ class PathExprToDebug extends RelevantExpr {
190190 PathExprToDebug ( ) { this .getValue ( ) = "vs/nls" }
191191 }
192192
0 commit comments