commit | 76ad05527717a146257c705fa0626056db1f8ce4 | [log] [tgz] |
---|---|---|
author | Erich Gamma <egamma@microsoft.com> | Thu Oct 29 11:26:21 2015 +0100 |
committer | Erich Gamma <egamma@microsoft.com> | Thu Oct 29 11:26:21 2015 +0100 |
tree | 6ea00f9ebfc37f1f8f767b2a6dfff74c4a8601bd | |
parent | e9f0bae43b2b1d5a6c4dbc7e788ffc4afb0ba589 [diff] |
absorb getter to property change absorb new configuration API
NOTE: All content within this repo is private and cannot be shared with others without the express written permission of the product team.
This extension adds rich language support for the Go language to VS Code, including:
gocode
)godef
)godef
)go-find-references
)go-outline
)gorename
)go build
and go test
)goreturns
or goimports
or gofmt
)delve
)First, you will need to install Visual Studio Code 0.9.1
.
Next, clone this repo into your Code extensions folder and run npm install
.
cd ~/.vscode/extensions/ git clone https://monacotools.visualstudio.com/DefaultCollection/Monaco/_git/go-code cd go-code npm install
In a terminal window with the GOPATH environment variable set to the GOPATH you want to work on, launch code
. Open you GOPATH folder or any subfolder you want to work on, then open a .go
file to start editing.
To use the debugger, you must currently manually install delve
. See the Installation Instructions for full details. This is not yet supported on Windows, and on OS X it requires creating a self-signed cert to sign the dlv
binary.
Once this is installed, go to the Code debug viewlet and select the configuration gear, placing the following in your launch.json:
{ "version": "0.1.0", "configurations": [ { "name": "Delve test", "type": "go", "program": "/Users/lukeh/dd/go/src/github.com/lukehoban/azuretest/test.go" } ] }
You can set up a development environment for debugging the extension during extension development.
First make sure you do not have the extension installed in ~/.vscode/extensions
. Then clone the repo somewhere else on your machine, run npm install
and open a development instance of Code.
rm -rf ~/.vscode/extensions/go-code cd ~ git clone https://monacotools.visualstudio.com/DefaultCollection/Monaco/_git/go-code cd go-code npm install code .
To build, use the Tasks: Run Build Task
command (cmd-shift-B
). This will start a build watcher so that .ts files are compiled on save.
You can now go to the Debug viewlet and select Launch Extension
then hit play (F5
).
In the [Extension Development Host]
instance, open your GOPATH folder.
You can now hit breakpoints and step through the extension.
If you make edits in the extension .ts
files, just reload (cmd-r
) the [Extension Development Host]
instance of Code to load in the new extension code. The debugging instance will automatically reattach.
The extension uses the following tools, installed in the current GOPATH. If any tools are missing, the extension will offer to install them for you.
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/nsf/gocode
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-find-references
And for debugging:
go get -u -v github.com/derekparker/delve/cmd/dlv