Closed kozer closed 2 years ago
No suggestions from cmp at all? Or no suggestions from copilot?
No suggestions from copilot. cmp work as expected.
As a side note, ~/.config/copilot
files are there.
Are you on neovim .6 or .7? I am looking into making some debug functions but doing so for .7 is much, much easier.
As I said in my original post, I'm on 0.6.1
As I said in my original post, I'm on 0.6.1
Apologies, I missed that. I think I know the issue, there will be a patch out soon. It's a part of copilot.lua actually
Thank you for that! :)
I just pushed an update, can you test it out?
Yes, I tested it but still, no luck... I'll try to update to the new version (0.7) and see how it goes. (Although I don't see any package on arch for 0.7)
I am on arch myself. I personally build from source often, but you can always use the nightly app images posted on the neovim github.
Also, there is an aur pkgbuild for it https://aur.archlinux.org/packages/neovim-nightly-bin. Apparently it refreshes the link it uses to the source based on the date, so even though it says .6 it should be .7
I find building from source best/easiest but the other two options are there.
Just make a script with something like the following if you don't want to install globally:
make CMAKE_BUILD_TYPE=RelWithDebInfo make CMAKE_INSTALL_PREFIX="~/progfiles/neovim-git" make install
and then in the Makefile change CMAKE_EXTRA_FLAGS to something like this
-DCMAKE_INSTALL_PREFIX=/home/zach/progfiles/neovim-git
I installed 0.7 but the problem remains. Actually, it happens something strange: I get results on the root level of the file. If I'm inside a function, I get nothing...
Somewhat similar experience, I'm on Manjaro. After updating to arch nvim nightly 0.7.0 dev+1400 package I see some suggestions. How it works, seems to depend on the language, in lua and especially C I get a bunch of suggestions while just writing code, but in C++ (which I used most) I get very few suggestions if at all. However, If I look at some video about copilot C++ (in vscode) and type the same, i.e. write a specific comment and then wait for suggestions I seem to get similar suggestions as well, and it seems more userfriendly with cmp where it shows the complete suggestion in the extra popup (or maybe the video was dated already), I guess I'll have to learn more about copilot.
At least as far as I can evaluate the nvim/cmp plugins work, cool, thx!
Copilot, by virtue of what it is, gives more results for some languages than others. @kozer I have found that longer files with more context tend to give far more results than others, but in some files I get similar results to yours.
I have a couple ideas on how to address this. As I said in a different post, the original copilot.vim sent a request on every insertchange with no debounce. I also recall it having a sleep time for awaiting/waiting on the response of 1ms. This is likely the reason for many of the performance issues associated with copilot.vim, but also for its 'responsiveness'. I plan to implement a configuration option using uv loops which will do a similar process, albeit hopefully slightly more efficient since it will be lua and not vimscript, which users can opt for.
Another idea I am considering as a configuration option in copilot.lua, is sending recursive context configurable by depth from things like import
, require
, or #include
within the files. Doing this based on workspace would also probably work, but either option would have dramatic performance implications.
I will be testing out .6 locally myself to confirm that it is working for me later today. Once I have done so, and confirmed it works, I'll be moving on to drawing up some ideas for preemptively sending requests for completions to increase responsiveness, but this is not a trivial feature.
Should be fixed via my most recent commit.
I just pushed a sizable fix. Apparently, due to the incredibly strange way copilot returns start and endpoints for its completions, and the fact that if those are incorrect, cmp will just ignore them, @kozer 's observation was correct. The offset for completions outside of the root level was causing them not to appear.
This should be resolved now. Initially, the implementation caused a large delay in all completions appearing, but I changed it so that normal completions should appear quickly, while copilot completions may take a short moment to pop in, as the copilot completions do take longer. Please let me know if you notice any performance issues.
I am going to tentatively close this, as I strongly believe the issue has been addressed, but do not hesitate to reopen it or create a new one if you still are not receiving completions after packer sync'ing
I'm currently on neovim 0.6.1. My config is the following:
And in packer I have:
When I write code, I get no suggestions, although with copilot.vim, everything worked as expected. Any ideas on why is that? Thanks!
PS: When I run
:LspInfo
I get: