Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug vim install #493

Open
phouse512 opened this issue Jan 16, 2018 · 0 comments
Open

debug vim install #493

phouse512 opened this issue Jan 16, 2018 · 0 comments

Comments

@phouse512
Copy link

Hello, I've searched through issues and been looking for help with getting autocomplete setup with Vundle, but I've had no luck. I believe my GOROOT and GOPATH env vars are set correctly, and when I manually call the gocode daemon, I get a response but I'm not really sure how to further debug.

For reference, here are my GOROOT and `GOPATH outputs:

$ echo $GOPATH
/Users/<user>/os/go
$ echo $GOROOT
/usr/local/go

If I run gocode manually using a command like this, I get the following output:

$ gocode -f=json --in=main.go autocomplete 14
[0, [{"class": "func", "name": "main", "type": "func()", "package": ""}, {"class": "type", "name": "Configuration", "type": "struct", "package": ""}]]

This is what the output of gocode close && gocode -s -debug looks like when I run that. Otherwise I see no output from the debug mode even when I am using go files in vim.

2018/01/15 20:02:15 Go project path: github.com/phouse512/boom
2018/01/15 20:02:15 Got autocompletion request for '/Users/<user>/os/go/src/github.com/phouse512/boom/main.go'
2018/01/15 20:02:15 Cursor at: 14
2018/01/15 20:02:15 -------------------------------------------------------
package main

#import (
	"fmt"
	"github.com/urfave/cli"
    "os"
)

type Configuration struct {
}

func main() {
	app := cli.NewApp()
	app.Name = "boom"
	app.Usage = "Here's how you use boom"
	app.Action = func(c *cli.Context) error {
		fmt.Println("Not sure.")
		return nil
	}
	app.Run(os.Args)
}
2018/01/15 20:02:15 -------------------------------------------------------
2018/01/15 20:02:15 Error parsing input file (outer block):
2018/01/15 20:02:15  3:1: expected declaration, found ';'
2018/01/15 20:02:15 Offset: 0
2018/01/15 20:02:15 Number of candidates found: 2
2018/01/15 20:02:15 Candidates are:
2018/01/15 20:02:15   func main()
2018/01/15 20:02:15   type Configuration struct
2018/01/15 20:02:15 =======================================================

I'm aware that this might be an issue with the Vundle install as well, but I just wanted to make sure that there wasn't anything blatantly wrong with my usage of gocode. Maybe I am not sure what is supposed to know what happens when I open a go file - but when I start typing, nothing comes up.

Any help would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant