From fc4d0287afc3ecc905ec5695aee8b46ba82e5d40 Mon Sep 17 00:00:00 2001 From: Erik Tetland Date: Sat, 29 Jun 2019 17:37:11 +0000 Subject: [PATCH 1/2] run daemon from path, remove broken installer --- plugins/c9.ide.language.go/README.md | 7 ++++++- plugins/c9.ide.language.go/worker/go_completer.js | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/c9.ide.language.go/README.md b/plugins/c9.ide.language.go/README.md index b15db220c..9b626f737 100644 --- a/plugins/c9.ide.language.go/README.md +++ b/plugins/c9.ide.language.go/README.md @@ -14,6 +14,11 @@ for an overview of the APIs and techniques used in this plugin. This plugin is still marked "experimental". To use it in Cloud9, please go to Cloud9 > Preferences > Experimental > Go Code Completion. +Make sure that go and gocode are installed on your path +sudo apt install go +go get github.com/stamblerre/gocode + ## License -MIT \ No newline at end of file +MIT + diff --git a/plugins/c9.ide.language.go/worker/go_completer.js b/plugins/c9.ide.language.go/worker/go_completer.js index d4218f15b..391c2b9ea 100644 --- a/plugins/c9.ide.language.go/worker/go_completer.js +++ b/plugins/c9.ide.language.go/worker/go_completer.js @@ -65,11 +65,11 @@ handler.complete = function(doc, fullAst, pos, options, callback) { var start = Date.now(); workerUtil.execAnalysis( - "bash", // TODO: don't use bash here, better GOPATH handling + "bash", // TODO: don't use bash here { args: [ "-c", - "GOPATH=$HOME/.c9/gocode:$GOPATH ~/.c9/gocode/bin/gocode -f=json autocomplete " + getOffset(doc, pos) + "gocode -f=json autocomplete " + getOffset(doc, pos) ], mode: "stdin", json: true, @@ -158,8 +158,8 @@ function ensureDaemon(callback) { "bash", { args: [ - // TODO: cleanup install procedure - "-c", "mkdir -p ~/.c9/gocode; GOPATH=$HOME/.c9/gocode go get -u github.com/nsf/gocode && ~/.c9/gocode/bin/gocode" + // TODO: install procedure + "-c", "gocode" ] }, function(err, child) { @@ -185,7 +185,7 @@ function ensureDaemon(callback) { if (err) { daemon.err = err; if (err.code !== "ELOADING") - workerUtil.showError("Could not setup or start Go completion daemon. Please reload to try again."); + workerUtil.showError("Could not setup or start Go completion daemon. Make sure go and gocode are installed on your path, and reload to try again."); return callback(err); } callback(); From 42949a0a2313edaedff9cc6a07d36ae632bf4796 Mon Sep 17 00:00:00 2001 From: Erik Tetland Date: Sat, 29 Jun 2019 12:29:37 -0600 Subject: [PATCH 2/2] go get gocode -> apt install --- plugins/c9.ide.language.go/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/c9.ide.language.go/README.md b/plugins/c9.ide.language.go/README.md index 9b626f737..1732c3edb 100644 --- a/plugins/c9.ide.language.go/README.md +++ b/plugins/c9.ide.language.go/README.md @@ -15,8 +15,8 @@ This plugin is still marked "experimental". To use it in Cloud9, please go to Cloud9 > Preferences > Experimental > Go Code Completion. Make sure that go and gocode are installed on your path -sudo apt install go -go get github.com/stamblerre/gocode +- sudo apt install go +- sudo apt install gocode ## License