Skip to content
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

Address layering of navigation action in code actions #59856

Merged

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

Copy link
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.

Nice approach; didn't realize we also had the navigation annotation too so makes sense all navigation is done in one place anyways.


public DocumentNavigationOperation(DocumentId documentId, int position = 0)
public DocumentNavigationOperation(DocumentId documentId!!, int position = 0)
Copy link
Member

Choose a reason for hiding this comment

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

!!

Copy link
Member Author

Choose a reason for hiding this comment

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

had to remove as well, was getting formatting warnings :'(

{
var navigationOperation = operations.OfType<DocumentNavigationOperation>().FirstOrDefault();
Copy link
Member

Choose a reason for hiding this comment

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

Consider SingleOrDefault, since if we have more than one I'm suspicious about what happened there.

Copy link
Member Author

Choose a reason for hiding this comment

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

well SingleOrDefault throws... and that worries me about somethign potentially throwing now taht just had wonky behavior before.

if (workspace.CanOpenDocuments)
{
var navigationService = workspace.Services.GetService<IDocumentNavigationService>();
var threadingService = workspace.Services.GetService<IWorkspaceThreadingServiceProvider>();
Copy link
Member

Choose a reason for hiding this comment

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

Can you delete IWorkspaceThreadingServiceProvider or did something else still use it too?

Copy link
Member Author

Choose a reason for hiding this comment

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

unfortunately, unit testing and TS are still using it in exactly 2 locations.

@CyrusNajmabadi CyrusNajmabadi merged commit 8212786 into dotnet:release/dev17.3 Mar 2, 2022
@CyrusNajmabadi CyrusNajmabadi deleted the codeActionDocNav branch March 2, 2022 07:04
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.

2 participants