From 8fb8dbc8d8945792bdac1e3533be4100b1459ef2 Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Sun, 20 Nov 2016 12:47:08 -0800 Subject: [PATCH] Update Readme and install logic --- README.md | 8 +++++--- src/goInstallTools.ts | 8 +++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 97e87738e..e3d92a374 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ Read the [Release Notes](https://github.com/Microsoft/vscode-go/wiki/Release-Not This extension adds rich language support for the Go language to VS Code, including: - Completion Lists (using `gocode`) -- Signature Help (using `godoc`) +- Signature Help (using `gogetdoc` or `godef`+`godoc`) - Snippets -- Quick Info (using `gogetdoc`) -- Goto Definition (using `gogetdoc`) +- Quick Info (using `gogetdoc` or `godef`+`godoc`) +- Goto Definition (using `gogetdoc` or `godef`+`godoc`) - Find References (using `guru`) - File outline (using `go-outline`) - Workspace symbol search (using `go-symbols`) @@ -198,6 +198,7 @@ To debug the debugger, see [the debugAdapter readme](src/debugAdapter/Readme.md) The extension uses the following tools, installed in the current GOPATH. If any tools are missing, you will see an "Analysis Tools Missing" warning in the bottom right corner of the editor. Clicking it will offer to install the missing tools for you. - gocode: `go get -u -v github.com/nsf/gocode` +- godef: `go get -u -v github.com/rogpeppe/godef` - gogetdoc: `go get -u -v github.com/zmb3/gogetdoc` - golint: `go get -u -v github.com/golang/lint/golint` - go-outline: `go get -u -v github.com/lukehoban/go-outline` @@ -211,6 +212,7 @@ The extension uses the following tools, installed in the current GOPATH. If any To install them just paste and run: ```bash go get -u -v github.com/nsf/gocode +go get -u -v github.com/rogpeppe/godef go get -u -v github.com/zmb3/gogetdoc go get -u -v github.com/golang/lint/golint go get -u -v github.com/lukehoban/go-outline diff --git a/src/goInstallTools.ts b/src/goInstallTools.ts index efa631cba..9164830cb 100644 --- a/src/goInstallTools.ts +++ b/src/goInstallTools.ts @@ -22,13 +22,19 @@ function getTools(goVersion: SemVersion): { [key: string]: string } { let tools: { [key: string]: string } = { 'gocode': 'github.com/nsf/gocode', 'gopkgs': 'github.com/tpng/gopkgs', - 'gogetdoc': 'github.com/zmb3/gogetdoc', 'go-outline': 'github.com/lukehoban/go-outline', 'go-symbols': 'github.com/newhook/go-symbols', 'guru': 'golang.org/x/tools/cmd/guru', 'gorename': 'golang.org/x/tools/cmd/gorename' }; + // Install the doc/def tool that was chosen by the user + if (goConfig['docsTool'] === 'godoc') { + tools['godef'] = 'github.com/rogpeppe/godef'; + } else if (goConfig['docsTool'] === 'gogetdoc') { + tools['gogetdoc'] = 'github.com/zmb3/gogetdoc'; + } + // Install the formattool that was chosen by the user if (goConfig['formatTool'] === 'goimports') { tools['goimports'] = 'golang.org/x/tools/cmd/goimports';