Show Golang Variable Type In Sublime Text 3

show golang variable type in sublime text 3

Show Golang Variable Type In Sublime Text 3

 |   |  0
Go Lang Programming

Show Golang variable type in Sublime Text 3

How to get go variable declared type in Sublime Text 3? It is really irritating for newbies.

AnacondaGO is a package that adds autocompletion, linting and IDE features for Golang to your Sublime Text 3 using anaconda's asynchronous engine so it shouldn't freeze your Sublime Text ever.

Install Package Control if not installed previously (ctrl+shift+p). It is a useful tool that will help you install and update new plugins for Sublime Text.

After you have installed this, open the Command Pallete, which can be opened from Sublime Text and pressing ctrl + shift + p.

Once opened, type: install

Then select: Package Control: Install Package

You will see all the available packages to install. enter AnacondaGO and install it.

This will allow you to look for the documentation of the current symbol under the cursor and retrieve the documentation in a bottom panel.

Usage

Then to get go variable declared type in Sublime Text 3, Place cursor over the variable and use the Command Palette - command "AncondaGO: Show Documentation".

Optionally you can also click the right mouse button and select the same options in the contextual menu that is shown under the AnacondaGO menu entry.

You can also add this to key bindings for get details faster. For that add this to key-bindings (Preference -> Key Bindings).

My suggested key bindings for this:


{ "keys": ["alt+k", "alt+d"], "command": "anaconda_go_doc", "context":
  [
    {"key": "selector", "operator": "equal", "operand": "(source.go)", "match_all": false}
  ]
}

Now just place cursor and enter k and d with holding alt, The documentation will show in bottom panel. Hope this helped you.

Reference: https://github.com/DamnWidget/anaconda_go


4 Claps

Show your love in the form of Claps and Comments...

Comments...

No comments found. Leave your reply here.