Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

goMain.ts add commands to Go: Show All Commands #1947

Closed

Conversation

vimalk78
Copy link
Contributor

commands added :

  • Go to definition
  • Go to implementation
  • Go to symbol in file
  • Go to symbol in workspace

fixes #1822

commands added :
 * Go to definition
 * Go to implementation
 * Go to symbol in file
 * Go to symbol in workspace

fixes microsoft#1822
@msftclas
Copy link

msftclas commented Sep 27, 2018

CLA assistant check
All CLA requirements met.

@vimalk78 vimalk78 closed this Sep 27, 2018
@vimalk78 vimalk78 reopened this Sep 27, 2018
extCommands.push({
command : 'editor.action.goToTypeDefinition',
title : 'Go : Go to Type Definition',
description : 'Go : invokes the GoDefinitionProvider'
Copy link
Contributor

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 title Go 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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. will change to editor.action.goToDeclaration .
  2. 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
  3. 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.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Sep 27, 2018

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'
})
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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

@vimalk78 vimalk78 closed this Sep 28, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Go to implementation cmd to the Go: Show all Commands for better discoverability
3 participants