habamax / vim-godot

Use vim and godot engine to make games
MIT License
498 stars 24 forks source link

CoC Command Not Found #15

Closed excalios closed 4 years ago

excalios commented 4 years ago

When using CoC for completion on enter it shows CoC Command not found

Screenshot from 2020-08-02 16-33-46

After pressing enter or arrow keys to complete it: Screenshot from 2020-08-02 16-34-00 Fixed the picture

habamax commented 4 years ago

I am not coc expert so I guess you should have asked this question on coc github

habamax commented 4 years ago

I mean this plugin doesn't do anything coc specific.

excalios commented 4 years ago

Yes i would've done that but before submitting i was checking with my other files and it only happens with godot files. Other files works fine with CoC

habamax commented 4 years ago

Well, you can remove vim-godot and try again coc with gd file. If issue is still there (it should) then ask coc team. If not we will try to debug it.

excalios commented 4 years ago

If i remove vim-godot then the godot code completion won't show up it'll only show up based on text that already exist in the file. And if i complete it with for example _physics_process it got no problem at all. But when i use vim-godot again all the godot completion show up but when i pressed enter it deleted the completion and showed Command: not found instead

habamax commented 4 years ago

If i remove vim-godot then the godot code completion won't show up

That is strange. Probably coc depedns on filetype definition. Could you, with removed vim-godot, do following:

  1. open your gdscript file (godot engine should be already running)
  2. your gdscript file should have empty filetype, i.e. set ft? should echo filetype=
  3. run vim command :set ft=gdscript and check coc-completion

For me it looks like this: image

excalios commented 4 years ago

Okay thank you that showed the completion but the problem still persist. I checked the CoC log since this only exist with godot files and found this Screenshot from 2020-08-03 15-54-30

Looking at this my first thought was this problem has something to do with the language server instead of CoC or your plugin. But i'm very unsure

habamax commented 4 years ago

Okay thank you that showed the completion but the problem still persist. I checked the CoC log since this only exist with godot files and found this

Sure. I just wanted to let you know that vim-godot does nothing with coc or language server.

Looking at this my first thought was this problem has something to do with the language server instead of CoC or your plugin. But i'm very unsure

Looks like godot language server has some issues with your coc/vim setup.

Just for reference, I have following setup:

https://github.com/habamax/.vim/blob/22a7363b95494d5dbe317c5cd68a2efb6719e453/coc-settings.json#L8

https://github.com/habamax/.vim/blob/master/autoload/habacoc.vim

excalios commented 4 years ago

Yeah i'm not sure currently i've tried deleting my coc/vim setup still doesn't work but thank you so much for the help

excalios commented 3 years ago

I found this workaround https://github.com/godotengine/godot/issues/34523#issuecomment-674573792

I believe this happens with coc#_select_confirm() command. Coc have an example config which set to this if pumvisible. If you don't use it it shouldn't be a problem. I personally feel this is not a good workaround.

ghost commented 3 years ago

My workaround was to disable coc from completing the first entry and just using tab to auto-complete. This is a bit annoying but it does make my sanity better.

habamax commented 3 years ago

My workaround was to disable coc from completing the first entry and just using tab to auto-complete. This is a bit annoying but it does make my sanity better.

I don't have that issue at all as @excalios mentioned it emerges when you setup coc to call _select_confirm which (probably) is not implemented in godot lsp.

With my setup (https://github.com/habamax/.vim/blob/d3dba0102341bf392bc82ff7575f54f81efdfe33/autoload/lsp.vim#L40) Coc autocompletes with no errors given.