This commit is contained in:
Liang Ding 2015-03-10 11:49:38 +08:00
parent 46e187a1a8
commit 02a660109a
1 changed files with 2 additions and 7 deletions

View File

@ -160,16 +160,11 @@ func AutocompleteHandler(w http.ResponseWriter, r *http.Request) {
// FIXME: using gocode set lib-path has some issues while accrossing workspaces
gocode := util.Go.GetExecutableInGOBIN("gocode")
argv := []string{"set", "lib-path", libPath}
exec.Command(gocode, argv...).Run()
exec.Command(gocode, []string{"set", "lib-path", libPath}...).Run()
argv = []string{"-f=json", "autocomplete", strconv.Itoa(offset)}
argv := []string{"-f=json", "--in=" + path, "autocomplete", strconv.Itoa(offset)}
cmd := exec.Command(gocode, argv...)
stdin, _ := cmd.StdinPipe()
stdin.Write([]byte(code))
stdin.Close()
output, err := cmd.CombinedOutput()
if nil != err {
logger.Error(err)