-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
@@ -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; | |||
} |
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 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() |
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 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.
No description provided.