-
Notifications
You must be signed in to change notification settings - Fork 645
goMain.ts add commands to Go: Show All Commands #1947
Conversation
commands added : * Go to definition * Go to implementation * Go to symbol in file * Go to symbol in workspace fixes microsoft#1822
extCommands.push({ | ||
command : 'editor.action.goToTypeDefinition', | ||
title : 'Go : Go to Type Definition', | ||
description : 'Go : invokes the GoDefinitionProvider' |
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
editor.action.goToDeclaration
with titleGo to Definition
. - We can skip the description. It doesnt get used in the
Show all commands
feature - Let's not include the prefix
Go:
in the title.
The prefix is for commands explicitly registered and implemented by the Go extension.
Where as these 4 commands that we are adding is registered in core VS Code an is only implemented by the Go extension
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.
- will change to
editor.action.goToDeclaration
. - description i kept for sake of documentation. it was hard for me to see the connection between the various
Providers
in the vscode-go extension and their corresponding internal commands. thats why initially i started with creating a new command - ok will remove the 'Go:' prefix, else it may be thought of a separate command.
in fact i was looking for some api to get the complete command object for these four commands, so that title, description etc can be reused directly. i couldn't find so created the literals.
Thanks for the PR! By the way, if you are interested in winning a t-shirt in the hactoberfest, close this PR and open a new one in October. See https://open.microsoft.com/2018/09/18/hacktoberfest-2018-microsoft/?WT.mc_id=hacktoberfest-twitter-beverst for more details |
command : 'editor.action.goToImplementation', | ||
title : 'Go : Go to Implementation', | ||
description : 'Go : invokes the GoImplementationProvider' | ||
}) |
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.
Missing semicolon for each of the push
is causing linting errors in the build
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.
thanks. i am new to type script.
is there a way to run such checks locally? before sending the PR
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.
Yes, you can run npm run lint
in the terminal
commands added :
fixes #1822