Skip to content

Commit

Permalink
add workspace symbol support
Browse files Browse the repository at this point in the history
  • Loading branch information
gayanper committed Sep 17, 2024
1 parent 099d018 commit 985eb3f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin;
import org.eclipse.jdt.ls.core.internal.ProjectUtils;
import org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager;
import org.eclipse.jdt.ls.core.internal.preferences.Preferences.SearchScope;
import org.eclipse.lsp4j.Location;
import org.eclipse.lsp4j.SymbolInformation;
import org.eclipse.lsp4j.SymbolKind;
Expand Down Expand Up @@ -126,8 +127,8 @@ private static IJavaSearchScope createSearchScope(String projectName, boolean so
if (!sourceOnly && preferenceManager != null && preferenceManager.isClientSupportsClassFileContent()) {
scope |= IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SYSTEM_LIBRARIES;
}

return SearchEngine.createJavaSearchScope(targetProjects, scope);
var excludeTestCode = preferenceManager.getPreferences().getSearchScope() == SearchScope.main;
return SearchEngine.createJavaSearchScope(excludeTestCode, targetProjects, scope);
}

public static class SearchSymbolParams extends WorkspaceSymbolParams {
Expand Down

0 comments on commit 985eb3f

Please sign in to comment.