File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
java-extension/com.microsoft.java.test.plugin/src/main/java/com/microsoft/java/test/plugin/util Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 4444import org .eclipse .jdt .ls .core .internal .JDTUtils ;
4545import org .eclipse .jdt .ls .core .internal .ProjectUtils ;
4646import org .eclipse .jdt .ls .core .internal .handlers .DocumentLifeCycleHandler ;
47+ import org .eclipse .jdt .ls .core .internal .managers .ProjectsManager ;
4748import org .eclipse .lsp4j .Location ;
4849
4950import java .net .URISyntaxException ;
5556import java .util .Objects ;
5657import java .util .Set ;
5758import java .util .stream .Collectors ;
59+ import java .util .stream .Stream ;
5860
5961@ SuppressWarnings ("restriction" )
6062public class TestSearchUtils {
@@ -288,8 +290,10 @@ private static IJavaSearchScope createSearchScope(SearchTestItemParams params)
288290 throws JavaModelException , URISyntaxException {
289291 switch (params .getLevel ()) {
290292 case ROOT :
291- final IJavaProject [] projects = JavaCore .create (ResourcesPlugin .getWorkspace ().getRoot ())
292- .getJavaProjects ();
293+ final IJavaProject [] projects = Stream .of (ProjectUtils .getJavaProjects ())
294+ .filter (javaProject -> !ProjectsManager .DEFAULT_PROJECT_NAME
295+ .equals (javaProject .getProject ().getName ()))
296+ .toArray (IJavaProject []::new );
293297 return SearchEngine .createJavaSearchScope (projects , IJavaSearchScope .SOURCES );
294298 case FOLDER :
295299 final Set <IJavaProject > projectSet = ProjectTestUtils .parseProjects (params .getUri ());
You can’t perform that action at this time.
0 commit comments