Skip to content

Commit

Permalink
Improve support for LangServ workspace in CH/MS directory
Browse files Browse the repository at this point in the history
  • Loading branch information
PseudoKnight committed Jun 15, 2022
1 parent 9d116fa commit cb92310
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/main/java/com/laytonsmith/tools/langserv/LangServModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.laytonsmith.core.MSLog;
import com.laytonsmith.core.MethodScriptCompiler;
import com.laytonsmith.core.ParseTree;
import com.laytonsmith.core.Prefs;
import com.laytonsmith.core.Profiles;
import com.laytonsmith.core.Script;
import com.laytonsmith.core.ScriptProvider;
Expand Down Expand Up @@ -195,6 +196,34 @@ private void syncRebuild() {
for(WorkspaceFolder folder : getWorkspaceFolders()) {
URI uuri = new URI(folder.getUri());
File ai = Paths.get(uuri).toFile();
File lp = new File(ai, "LocalPackages");
if(lp.exists()) {
// If this is the parent directory of LocalPackages,
// this may contain special files and directories.
File main = new File(ai, Prefs.MainFile());
if(main.exists()) {
mainFiles.add(main);
}
File aliases = new File(ai, Prefs.ScriptName());
if(aliases.exists()) {
mainFiles.add(aliases);
}
File autoInclude = new File(ai, "auto_include.ms");
if(autoInclude.exists()) {
autoIncludes.add(autoInclude);
}
File includes = new File(ai, "includes");
if(includes.exists() && includes.isDirectory()) {
FileUtil.recursiveFind(includes, (r) -> {
String path = r.getAbsolutePath().replace("\\", "/");
if(path.endsWith(".ms")) {
libraryFiles.add(r);
}
});
}
// Now process LocalPackages
ai = lp;
}
FileUtil.recursiveFind(ai, (r) -> {
String path = r.getAbsolutePath().replace("\\", "/");
if(!path.contains(".disabled/") && r.isFile()) {
Expand Down

0 comments on commit cb92310

Please sign in to comment.