This commit is contained in:
Liang Ding 2014-09-17 16:13:00 +08:00
parent 0524bad90c
commit 3b5ce0c3ec
1 changed files with 2 additions and 8 deletions

View File

@ -142,16 +142,10 @@ func AutocompleteHandler(w http.ResponseWriter, r *http.Request) {
// FIXME: 使用 gocode set lib-path 在多工作空间环境下肯定是有问题的,需要考虑其他实现方式 // FIXME: 使用 gocode set lib-path 在多工作空间环境下肯定是有问题的,需要考虑其他实现方式
gocode := conf.Wide.GetGocode() gocode := conf.Wide.GetGocode()
argv := []string{"set", "lib-path", libPath} argv := []string{"set", "lib-path", libPath}
cmd := exec.Command(gocode, argv...) exec.Command(gocode, argv...).Run()
cmd.Run()
//gocode 试验性质特性:自动构建
//argv = []string{"set", "autobuild", "true"}
//cmd := exec.Command("gocode", argv...)
//cmd.Start()
argv = []string{"-f=json", "autocomplete", strconv.Itoa(offset)} argv = []string{"-f=json", "autocomplete", strconv.Itoa(offset)}
cmd = exec.Command(gocode, argv...) cmd := exec.Command(gocode, argv...)
stdin, _ := cmd.StdinPipe() stdin, _ := cmd.StdinPipe()
stdin.Write([]byte(code)) stdin.Write([]byte(code))