gocode icon indicating copy to clipboard operation
gocode copied to clipboard

Error parsing input file

Open imoverclocked opened this issue 9 years ago • 3 comments

I see this text (and lack of any completion when I run gocode -s -debug

2016/09/01 18:47:02 -------------------------------------------------------
2016/09/01 18:47:02 Found "fmt" at "/usr/local/Cellar/go/1.7/libexec/pkg/darwin_amd64/fmt.a"
2016/09/01 18:47:02 Found "io" at "/usr/local/Cellar/go/1.7/libexec/pkg/darwin_amd64/io.a"
2016/09/01 18:47:02 Found "internal-domain.com/imoverclocked/proj1/protobuf" at "/Users/imoverclocked/go/pkg/darwin_amd64/internal-domain.com/imoverclocked/proj1/protobuf.a"
2016/09/01 18:47:02 Found "internal-domain.com/imoverclocked/proj1/shared" at "/Users/imoverclocked/go/pkg/darwin_amd64/internal-domain.com/imoverclocked/proj1/shared.a"
2016/09/01 18:47:02 Found "golang.org/x/net/context" at "/Users/imoverclocked/go/pkg/darwin_amd64/golang.org/x/net/context.a"
2016/09/01 18:47:02 Error parsing input file (inner block):
2016/09/01 18:47:02  6:10: expected selector or type assertion, found ';'
2016/09/01 18:47:02  7:2: expected ';', found 'if'
2016/09/01 18:47:02 extracted expression tokens: api.cfg
2016/09/01 18:47:02 Offset: 0
2016/09/01 18:47:02 Number of candidates found: 0
2016/09/01 18:47:02 Candidates are:
2016/09/01 18:47:02 =======================================================

I recently updated go from 1.6 to 1.7 and blew away $GOPATH/pkg/* to make sure I wasn't getting any old pre-compiled binaries. At some point, restarting gocode cleared the issue without any other changes to the system.

imoverclocked avatar Sep 02 '16 01:09 imoverclocked

Input parsing errors like that are okay.

nsf avatar Sep 02 '16 08:09 nsf

Just to clear that out. Gocode works with incorrect go code, I've added parser errors to the debug output to be able to investiage some weird cases, this case doesn't appear to be weird because gocode inserts ';' on cursor location to prevent some incorrect parsing in some edge cases. So, gocode may report such errors on all autocompletion requests. However, if this is something that you consider a valid case and you see no autocompletion I need a way to reproduce it. Since the log doesn't include the test case, I can't help you.

nsf avatar Sep 17 '16 16:09 nsf

I've long since cleared out my cache of go 1.6 cached objects so I can't reproduce anymore. Sorry. It seemed to be related to having both 1.6 and 1.7 objects around though. In the end, I just rebuilt gocode (and all of my other deps) and the problem went away.

imoverclocked avatar Sep 21 '16 00:09 imoverclocked