nsf / gocode

An autocompletion daemon for the Go programming language
MIT License
5.01k stars 656 forks source link

gocode no return #503

Open akiyosi opened 6 years ago

akiyosi commented 6 years ago

I setup zchee/deoplete-go but it does not work. I ran gocode command with reference to zchee/deoplete-go#50, but nothing was returned. What is the problem?

$ cp ~/.config/nvim/dein/repos/github.com/zchee/deoplete-go/tests/fmt.go fmt.go
$ cat fmt.go
package main

import (
        "fmt"
        "net"
        "os"
        "strconv"
        "syscall"
)

var str string

func main() {
        fmt.Println(os.Args[0])
        fmt.Println(net.InterfaceAddrs())

        fmt.Println(strconv.FormatInt(int64(syscall.Getuid()), 10))
}
$ gocode -f json --in fmt2.go autocomplete 128
$

I installed gocode with following command.

$ go get -u -v github.com/nsf/gocode

My environment is following.

$ goenv versions
  1.10rc1
  1.10rc2
* 1.9.4 (set by /Users/akiyosi/.goenv/version)
nsf commented 6 years ago

why should it work? 128 byte is here:

package main

import (
        "fmt"
        "net"
        "os"
        "strconv"
        "syscall"
)

var str string

func main>>>>>#<<<<<() {
        fmt.Println(os.Args[0])
        fmt.Println(net.InterfaceAddrs())

        fmt.Println(strconv.FormatInt(int64(syscall.Getuid()), 10))
}

I'm not sure what to explain here really. Try debug mode maybe: gocode close && gocode -s -debug.