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

Simplify goto def command handler #59769

Merged
merged 4 commits into from
Feb 25, 2022

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

@@ -98,8 +99,6 @@ internal static bool TryExecuteCommand(Document document, int caretPosition, IGo
var notificationService = workspace.Services.GetService<INotificationService>();
notificationService.SendNotification(errorMessage, title: EditorFeaturesResources.Go_to_Definition, severity: NotificationSeverity.Information);
}

return true;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

this method always returned 'true', so could just simplify the stack all the way up.

@@ -66,13 +65,14 @@ class C
Dim mockDocumentNavigationService =
DirectCast(workspace.Services.GetService(Of IDocumentNavigationService)(), MockDocumentNavigationService)

GoToDefinitionCommandHandler.TryExecuteCommand(view.TextSnapshot, baseDocument.CursorPosition.Value, TestCommandExecutionContext.Create())
Dim handler = New GoToDefinitionCommandHandler()
Copy link
Member

@sharwell sharwell Feb 25, 2022

Choose a reason for hiding this comment

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

📝 This should be obtained through the MEF catalog instead of directly constructed. Looks like it's not the only case where this is happening though, so not a blocker at this point. Just makes it more work when we do eventually clean it up.

@CyrusNajmabadi CyrusNajmabadi merged commit 3edf5a4 into dotnet:main Feb 25, 2022
@ghost ghost added this to the Next milestone Feb 25, 2022
@CyrusNajmabadi CyrusNajmabadi deleted the simplifyGoToDef branch February 25, 2022 19:47
@RikkiGibson RikkiGibson modified the milestones: Next, 17.2.P2 Mar 1, 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.

4 participants