Conversation
|
@sharwell What is this for? |
|
@CyrusNajmabadi ask mode template updated to explain the change |
|
@jasonmalinowski @minestarks @brettfo I have manually verified the repro state and the fix for both TypeScript and F#, so I am now confident this will work. |
jasonmalinowski
left a comment
There was a problem hiding this comment.
Calling this an "approve with requested changes" -- mostly just a request for some comments and better text for the Obsolete, since the message isn't actually advice we want to give anyone.
| } | ||
|
|
||
| #pragma warning disable CS0618 // Type or member is obsolete | ||
| var legacyNavigateToSearchService = project.LanguageServices.GetService<INavigateToSearchService>(); |
There was a problem hiding this comment.
Any reason this method isn't just using your other helper that already does the "return an interface"? I recognize it'll allocate a shim which will then cause this loop to bail, but it's a single allocation per search, which seems pretty cheap compared to the duplicate logic here.
There was a problem hiding this comment.
(bonus points for a "get all services" helper that just does the loop and is consumed in both properties)
| var navigateToSearchService = project.LanguageServices.GetService<INavigateToSearchService_RemoveInterfaceAboveAndRenameThisAfterInternalsVisibleToUsersUpdate>(); | ||
| if (navigateToSearchService != null) | ||
| { | ||
| result = result.Union(navigateToSearchService.KindsProvided); |
There was a problem hiding this comment.
This is supposed to be a NOP on each loop. It's not clear whether ImmutableHashSet<T> implements the necessary edge cases as fast paths.
- When
resultis empty, the right hand side is returned - When the right hand side is empty,
resultis returned unaltered - In all other cases where the solution does not contain both C#/VB and F#/TypeScript projects,
resultand the right hand side reference the same object
Even if the edge cases aren't dedicated fast paths, the fact that most iterations do not alter result means a builder would not provide noticeable benefits.
| if (navigateToSearchService != null) | ||
| { | ||
| result = result.Union(navigateToSearchService.KindsProvided); | ||
| continue; |
There was a problem hiding this comment.
continue doesn't need to be here.
|
|
||
| namespace Microsoft.CodeAnalysis.NavigateTo | ||
| { | ||
| [Obsolete("Use " + nameof(INavigateToSearchService_RemoveInterfaceAboveAndRenameThisAfterInternalsVisibleToUsersUpdate) + " instead.")] |
There was a problem hiding this comment.
So I'm not sure that's really the right message here: we sure don't want people moving to this new interface either...at least not with that name!
There was a problem hiding this comment.
This order allows the new interface to be implemented independently (the hard/slow part), then we can coordinate with all the repositories on an interface rename (the easy part).
There was a problem hiding this comment.
I guess I assumed that our path forward would be to directly work forward having people consume the existing name with new surface area, rather than moving to the new name and then moving back.
In any case "above" is a pretty meaningless name then for an external consumer to consume.
| Task<ImmutableArray<INavigateToSearchResult>> SearchDocumentAsync(Document document, string searchPattern, CancellationToken cancellationToken); | ||
| } | ||
|
|
||
| internal interface INavigateToSearchService_RemoveInterfaceAboveAndRenameThisAfterInternalsVisibleToUsersUpdate : ILanguageService |
There was a problem hiding this comment.
Please link to the tracking bug tracking the cleanup, and a quick discussion of how this type came into being. The PR description nor commit description really make this clear unless you're willing to chase through the original PR and figure out the context there.
* Use TryGetNavigateToSearchService instead of duplicating logic * Simplify code flow * Link to dotnet#28343 tracking interface rename
|
Approved to merge for 15.8.Preview5 |
|
@dotnet-bot test |
|
@dotnet-bot retest this please |
|
@dotnet-bot test this please |
dpoeschl
left a comment
There was a problem hiding this comment.
Something strange is happening with the tests. Temporarily blocking while we sort it out.
|
Merged for 15.8.Preview5 |
Customer scenario
In the latest 15.8 Preview 4 internal builds, Navigate To does not work for TypeScript or F#.
Bugs this fixes
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/644180
Workarounds, if any
None.
Risk
Medium risk. The safest option for release would be reverting the original change, but we would lose the substantial (clearly user visible) performance benefit it provided for Go To File.
Performance impact
This change enumerates the projects in a
Solutionto determine the supported Navigate To kinds each time the feature is used. However, this is not expected to result in substantial overhead compared to the underlying navigation operation.Is this a regression from a previous update?
Yes
Root cause analysis
TypeScript and F# support Navigate To by implementing
INavigateToSearchService(only available via IVTs and thus not under the protection of our public API surface change review process), but there is no test coverage for this feature in either language in either the dotnet/roslyn PR builds or the DDRITs used during the RI process.How was the bug found?
Dogfooding
Test documentation updated?
No