Skip to content

Commit 26325ed

Browse files
author
Gleez Technologies
committed
Golang Autocompletion c9#538
1 parent d371732 commit 26325ed

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

plugins/c9.ide.language.go/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ for an overview of the APIs and techniques used in this plugin.
1414
This plugin is still marked "experimental". To use it in Cloud9,
1515
please go to Cloud9 > Preferences > Experimental > Go Code Completion.
1616

17+
Make sure that go and gocode are installed on your path
18+
- sudo apt install go
19+
- sudo apt install gocode
20+
1721
## License
1822

19-
MIT
23+
MIT

plugins/c9.ide.language.go/worker/go_completer.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ handler.complete = function(doc, fullAst, pos, options, callback) {
6565

6666
var start = Date.now();
6767
workerUtil.execAnalysis(
68-
"bash", // TODO: don't use bash here, better GOPATH handling
68+
"bash", // TODO: don't use bash here
6969
{
7070
args: [
7171
"-c",
72-
"GOPATH=$HOME/.c9/gocode:$GOPATH ~/.c9/gocode/bin/gocode -f=json autocomplete " + getOffset(doc, pos)
72+
"gocode -f=json autocomplete " + getOffset(doc, pos)
7373
],
7474
mode: "stdin",
7575
json: true,
@@ -158,8 +158,8 @@ function ensureDaemon(callback) {
158158
"bash",
159159
{
160160
args: [
161-
// TODO: cleanup install procedure
162-
"-c", "mkdir -p ~/.c9/gocode; GOPATH=$HOME/.c9/gocode go get -u github.com/nsf/gocode && ~/.c9/gocode/bin/gocode"
161+
// TODO: install procedure
162+
"-c", "gocode"
163163
]
164164
},
165165
function(err, child) {
@@ -185,7 +185,7 @@ function ensureDaemon(callback) {
185185
if (err) {
186186
daemon.err = err;
187187
if (err.code !== "ELOADING")
188-
workerUtil.showError("Could not setup or start Go completion daemon. Please reload to try again.");
188+
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.");
189189
return callback(err);
190190
}
191191
callback();

0 commit comments

Comments
 (0)