File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 " com.fasterxml.jackson.core:jackson-annotations:jar:2.5.0:compile" ,
3232 " org.eclipse.lsp4j:org.eclipse.lsp4j.jsonrpc:jar:0.2.0-SNAPSHOT:compile"
3333 ],
34+ "java.sourceDirectories" : [
35+ " src/main/java" ,
36+ " src/test/java"
37+ ],
3438 "java.home" : " /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home"
3539}
Original file line number Diff line number Diff line change @@ -491,7 +491,7 @@ Javadocs docs() {
491491
492492 // TODO this function needs to be invoked whenever the user creates a new .java file outside the existing source root
493493 private void createCompiler () {
494- Set <Path > sourcePath = InferConfig .workspaceSourcePath (workspaceRoot );
494+ Set <Path > sourcePath = settings . java . sourceDirectories . orElseGet (() -> InferConfig .workspaceSourcePath (workspaceRoot ) );
495495 Path userHome = Paths .get (System .getProperty ("user.home" ));
496496 Path mavenHome = userHome .resolve (".m2" );
497497 Path gradleHome = userHome .resolve (".gradle" );
Original file line number Diff line number Diff line change 11package org .javacs ;
22
3+ import java .nio .file .Path ;
34import java .util .ArrayList ;
45import java .util .List ;
56import java .util .Optional ;
7+ import java .util .Set ;
68
79public class JavaSettings {
810 public Java java = new Java ();
911
1012 public static class Java {
1113 public List <String > externalDependencies = new ArrayList <>();
14+ public Optional <Set <Path >> sourceDirectories = Optional .empty ();
1215 public Optional <String > javaHome = Optional .empty ();
1316 }
1417}
You can’t perform that action at this time.
0 commit comments