-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Navto covers all projects #38027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navto covers all projects #38027
Changes from 1 commit
b48a724
40e80ca
e212f1e
fc8bc8b
600eb8a
9b218d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1901,16 +1901,16 @@ namespace ts.server { | |
| private getFullNavigateToItems(args: protocol.NavtoRequestArgs): readonly NavigateToItem[] { | ||
| const { currentFileOnly, searchValue, maxResultCount } = args; | ||
| if (!args.file) { | ||
|
||
| const items: NavigateToItem[] = []; | ||
| this.projectService.forEachEnabledProject(project => { | ||
| this.projectService.loadAncestorProjectTree(); | ||
| for (const item of project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*filename*/ undefined, /*excludeDts*/ project.isNonTsProject())) { | ||
| if (!contains(items, item, navigateToItemIsEqualTo)) { | ||
| items.push(item); | ||
| } | ||
| if (args.projectFileName) { | ||
| const project = this.projectService.findProject(args.projectFileName); | ||
| if (project) { | ||
|
||
| return project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*filename*/ undefined, /*excludeDts*/ project.isNonTsProject()); | ||
| } | ||
| }); | ||
| return items; | ||
| } | ||
| return combineProjectOutputFromEveryProject( | ||
| this.projectService, | ||
| project => project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*filename*/ undefined, /*excludeDts*/ project.isNonTsProject()), | ||
| (a, b) => a.fileName === b.fileName); | ||
|
||
| } | ||
| const fileArgs = args as protocol.FileRequestArgs; | ||
uniqueiniquity marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (currentFileOnly) { | ||
|
|
@@ -1921,8 +1921,7 @@ namespace ts.server { | |
| return combineProjectOutputWhileOpeningReferencedProjects<NavigateToItem>( | ||
| this.getProjects(fileArgs), | ||
| this.getDefaultProject(fileArgs), | ||
| project => | ||
| project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*fileName*/ undefined, /*excludeDts*/ project.isNonTsProject()), | ||
| project => project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*fileName*/ undefined, /*excludeDts*/ project.isNonTsProject()), | ||
| documentSpanLocation, | ||
| navigateToItemIsEqualTo); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the only substantive change. Everything else is a removal of a frankly ridiculous amount of destructuring/allocation to pass around a project+location pair.