Skip to content

Use VisualStudioWorkspaceImpl to perform navigation for Inheritance margin#62053

Merged
Cosifne merged 3 commits intodotnet:mainfrom
Cosifne:dev/shech/FixMetadataNavigation
Jun 28, 2022
Merged

Use VisualStudioWorkspaceImpl to perform navigation for Inheritance margin#62053
Cosifne merged 3 commits intodotnet:mainfrom
Cosifne:dev/shech/FixMetadataNavigation

Conversation

@Cosifne
Copy link
Copy Markdown
Member

@Cosifne Cosifne commented Jun 21, 2022

Fix the issue that in the current build, user couldn't navigate using inheritance margin when it is in the Metadata workspace.
Like
NavigateToNormal

The reason is, here if we are passing the workspace associated with the document to the glyph.
For symbol in source, inheritance margin use DocumentIdSpan to perform navigation, so if it is in the metadata workspace then it can't find the corresponding document in workspace.

Fix this issue by always using VisuaStudioWorkspaceImpl to perform navigation.

Currently, there is no way to cover this by a test, it would rely on #62047 merged in so that this scenario could be covered by Integration test.

@Cosifne Cosifne requested review from a team as code owners June 21, 2022 16:25
@ghost ghost added the Area-IDE label Jun 21, 2022
@Cosifne Cosifne removed the request for review from a team June 21, 2022 16:25
@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

this looks ok to me... but also somewhat off. I thought we had dedicated services to map between teh workspaces we get for MAS/Decompile/Etc (like ISymbolMappingService?). @davidwengier for more thoughts here.

Copy link
Copy Markdown
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

Echoing @CyrusNajmabadi concern's I'm a bit confused why this is working -- I would have expected the symbol mapping service be used here rather than hardcoding this.

@Cosifne
Copy link
Copy Markdown
Member Author

Cosifne commented Jun 21, 2022

this looks ok to me... but also somewhat off. I thought we had dedicated services to map between teh workspaces we get for MAS/Decompile/Etc (like ISymbolMappingService?). @davidwengier for more thoughts here.

Echoing @CyrusNajmabadi concern's I'm a bit confused why this is working -- I would have expected the symbol mapping service be used here rather than hardcoding this.

Combined both threads here.

The OOP side of the inheritance margin has already used ISymbolMappingService. So it has the correct DocumentId + Span passed back to devenv.
And the problem is solution in Metadata workspace can't find the document for it https://sourceroslyn.io/#Microsoft.CodeAnalysis.Features/DocumentIdSpan.cs,36

Or should the OOP send the symbolKey + projectId back to devenv and later we restore the symbol and use ISymbolMappingService to get the correct navigation location?

@davidwengier
Copy link
Copy Markdown
Member

I have nothing interesting to add. It makes sense if OOP is using the mapping service, its going to get a DocumentId from the VS workspace, so looking that up in the MAS workspace wouldn't work.

@Cosifne Cosifne enabled auto-merge (squash) June 27, 2022 21:24
@Cosifne Cosifne force-pushed the dev/shech/FixMetadataNavigation branch 2 times, most recently from c66df05 to 28c619d Compare June 28, 2022 15:37
@Cosifne Cosifne merged commit 263586b into dotnet:main Jun 28, 2022
@ghost ghost added this to the Next milestone Jun 28, 2022
@Cosifne Cosifne deleted the dev/shech/FixMetadataNavigation branch June 28, 2022 23:31
Cosifne added a commit to Cosifne/roslyn that referenced this pull request Jun 28, 2022
…argin (dotnet#62053)

* Use VisualStudioWorkspaceImpl

* Use VisualStudioWorkspace

* Add an integration test to cover the case
Cosifne added a commit that referenced this pull request Jun 29, 2022
…argin (#62053) (#62220)

* Use VisualStudioWorkspaceImpl

* Use VisualStudioWorkspace

* Add an integration test to cover the case
@allisonchou allisonchou modified the milestones: Next, 17.4 P1 Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants