@@ -79,7 +79,7 @@ map[loc, set[Message]] checkFile(loc l, set[loc] workspaceFolders, start[Module]
7979 openFileHeader = openFile .top .header .name ;
8080 checkForImports = [openFile ];
8181 checkedForImports = {};
82- initialProject = inferProjectRoot (l );
82+ initialProject = inferRoot (l );
8383
8484 rel [loc , loc ] dependencies = {};
8585
@@ -88,7 +88,7 @@ map[loc, set[Message]] checkFile(loc l, set[loc] workspaceFolders, start[Module]
8888 while (tree <- checkForImports ) {
8989 step2 ("Calculating imports for <tree .top .header .name > " , 1 );
9090 currentSrc = tree .src .top ;
91- currentProject = inferProjectRoot (currentSrc );
91+ currentProject = inferRoot (currentSrc );
9292 if (currentProject in workspaceFolders && currentProject .file notin {"rascal" , "rascal-lsp" }) {
9393 for (i <- tree .top .header .imports , i has \module ) {
9494 modName = "<i .\module > " ;
@@ -102,7 +102,7 @@ map[loc, set[Message]] checkFile(loc l, set[loc] workspaceFolders, start[Module]
102102 if (mlpt .src .top notin checkedForImports ) {
103103 checkForImports += mlpt ;
104104 jobTodo ("Building dependency graph" );
105- dependencies += <currentProject , inferProjectRoot (mlpt .src .top )>;
105+ dependencies += <currentProject , inferRoot (mlpt .src .top )>;
106106 }
107107 }
108108 }
@@ -123,7 +123,7 @@ map[loc, set[Message]] checkFile(loc l, set[loc] workspaceFolders, start[Module]
123123 if (cyclicDependencies != {}) {
124124 return (l : {error ("Cyclic dependencies detected between projects {<intercalate (", " , [*cyclicDependencies ])> }. This is not supported. Fix your project setup." , l )});
125125 }
126- modulesPerProject = classify (checkedForImports , loc (loc l ) {return inferProjectRoot (l );});
126+ modulesPerProject = classify (checkedForImports , loc (loc l ) {return inferRoot (l );});
127127 msgs = [];
128128
129129 upstreamDependencies = {project | project <- reverse (order (dependencies )), project in modulesPerProject , project != initialProject };
@@ -196,7 +196,7 @@ set[loc] locateRascalModules(str fqn, PathConfig pcfg, PathConfig(loc file) getP
196196 // Check the source directories
197197 return {fileLoc | dir <- pcfg .srcs , fileLoc := dir + fileName , exists (fileLoc )}
198198 // And libraries available in the current workspace
199- + {fileLoc | lib <- pcfg .libs , inWorkspace (workspaceFolders , lib ), dir <- getPathConfig (inferProjectRoot (lib )).srcs , fileLoc := dir + fileName , exists (fileLoc )};
199+ + {fileLoc | lib <- pcfg .libs , inWorkspace (workspaceFolders , lib ), dir <- getPathConfig (inferRoot (lib )).srcs , fileLoc := dir + fileName , exists (fileLoc )};
200200}
201201
202202loc targetToProject (loc l ) {
@@ -207,8 +207,8 @@ loc targetToProject(loc l) {
207207}
208208
209209@synopsis {Infers the root of the project that `member` is in.}
210- @javaClass {org.rascalmpl.vscode.lsp.rascal.model.ProjectRoots }
211- java loc inferProjectRoot (loc member );
210+ @javaClass {org.rascalmpl.vscode.lsp.rascal.model.Projects }
211+ java loc inferRoot (loc member );
212212
213213map [loc , set [Message ]] filterAndFix (list [ModuleMessages ] messages , set [loc ] workspaceFolders ) {
214214 set [Message ] empty = {};
0 commit comments