8000 Limit search scope of main class to source files and the specified project or paths by testforstephen · Pull Request #395 · microsoft/java-debug · GitHub
[go: up one dir, main page]

Skip to content

Limit search scope of main class to source files and the specified project or paths#395

Merged
testforstephen merged 3 commits intomicrosoft:mainfrom
testforstephen:jinbo_mainclass
Jan 24, 2022
Merged

Limit search scope of main class to source files and the specified project or paths#395
testforstephen merged 3 commits intomicrosoft:mainfrom
testforstephen:jinbo_mainclass

Conversation

@testforstephen
Copy link
Contributor
  • Allow searching main class from the specified project name
  • Limit search scope of search engine to SOURCES, this can boost main class resolving performance a lot


private List<ResolutionItem> resolveMainClassUnderProject(final String projectName) {
// Limit to search main method from source code only.
IJavaSearchScope searchScope = SearchEngine.createJavaSearchScope(ProjectUtils.getJavaProjects(),
Copy link
Member
@jdneo jdneo Jan 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since here we know the projectName already, what about we find out the IJavaProject according to the projectName, and pass it as the first param of SearchEngine.createJavaSearchScope()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

jdneo
jdneo previously approved these changes Jan 24, 2022
@testforstephen testforstephen merged commit 810d955 into microsoft:main Jan 24, 2022
@testforstephen testforstephen deleted the jinbo_mainclass branch January 24, 2022 02:20
@testforstephen
Copy link
Contributor Author

The search performance comparison:

Before: (7s to find main classes from spring-petclinic)

Screen.Recording.2022-01-24.at.10.43.59.mov

New: (1s to find main classes from spring-petclinic)

Screen.Recording.2022-01-24.at.10.50.44.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0