Giter VIP home page Giter VIP logo

Comments (10)

nsf avatar nsf commented on August 23, 2024

What's the Go version? What's the gocode version?

Can't reproduce on my machine, works just fine:
gocode

from gocode.

mattn avatar mattn commented on August 23, 2024

hg tip. I tested it with latest on windows.

from gocode.

nsf avatar nsf commented on August 23, 2024

Also, try this: run gocode daemon by hand in a separate console window. For windows:

start -> run... cmd
gocode close
gocode -s

and then try again. Since it is a daemon panic, it will show you the stack trace, put it here.

from gocode.

mattn avatar mattn commented on August 23, 2024
panic: runtime error: index out of range
1(runtime.panic): /go/src/pkg/runtime/proc.c:1275
2(runtime.panicstring): /go/src/pkg/runtime/runtime.c:128
3(runtime.panicindex): /go/src/pkg/runtime/runtime.c:85
4(main.utf8MoveBackwards): c:/temp/github/gocode/apropos.go:21
5(main.(*AutoCompleteContext).deduceDecl): c:/temp/github/gocode/apropos.go:130
6(main.(*AutoCompleteContext).Apropos): c:/temp/github/gocode/autocompletecontext.go:216
7(main.Server_AutoComplete): c:/temp/github/gocode/server.go:82
8(main.(*RPCRemote).RPCServer_AutoComplete): c:/temp/github/gocode/rpc.go:27
9(reflect.internalValue.call): c:/go/src/pkg/reflect/value.go:595
10(reflect.Value.Call): c:/go/src/pkg/reflect/value.go:445
11(rpc.(*service).call): c:/go/src/pkg/rpc/server.go:341
12(runtime.goexit): /go/src/pkg/runtime/proc.c:246

from gocode.

nsf avatar nsf commented on August 23, 2024

Hm, thanks, I've seen that error in the past. Can't remember what was wrong though.. Basically some kind of data is incorrect. This function "utf8MoveBackwards" is called when the editor issues autocompletion and gocode needs to move cursor back to the point where it can do autocompletion. And error originates from the point where no checks were performed, it simply takes the cursor position, moves it back and tries to access the buffer. I guess something of these two must be wrong. The cursor position or the contents of the buffer. Could be a vim script that fails to send the right data or something else.

Well.. I don't know, check these two vars by yourself somewhere around the error, 'file' should contain the buffer of the file you're editting and 'cursor' is an offset in bytes from the beginning of the buffer to the cursor position. If one of these is incorrect try to figure out why.

I'll try to reproduce the bug on my windows machine, but I don't know when I will be there and if it can be reproduced at all.

Also I strongly recommend you to use at least weekly versions. It's hard for me to work on abstract 'hg tip', because at the time when I will get to my windows machine most likely it's different 'hg tip' already.

from gocode.

nsf avatar nsf commented on August 23, 2024

One reason I can imagine why it may happen, is vim's "line2byte". I think vim needs to be compiled with +byte_offset option.
See vim --version

from gocode.

mattn avatar mattn commented on August 23, 2024

My vim --version

+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent 
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs 
-dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path 
+find_in_path +float +folding -footer +gettext/dyn -hangul_input +iconv/dyn 
+insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent 
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape 
+multi_byte_ime/dyn +multi_lang -mzscheme -netbeans_intg +path_extra +perl/dyn 
+persistent_undo -postscript +printer -profile +python/dyn -python3 +quickfix 
+reltime +rightleft +ruby/dyn +scrollbind +signs +smartindent -sniff 
+startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static 
-tag_any_white -tcl -tgetent -termresponse +textobjects +title -toolbar 
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace 
+wildignore +wildmenu +windows +writebackup -xfontset -xim -xterm_save -xpm_w32

from gocode.

nsf avatar nsf commented on August 23, 2024

well, it has +byte_offset, that's the only weird feature I use in vim

from gocode.

mattn avatar mattn commented on August 23, 2024

ok, I'll figure out it later. :)

from gocode.

nsf avatar nsf commented on August 23, 2024

was fixed by pull request 50

from gocode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.