-
Notifications
You must be signed in to change notification settings - Fork 45
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
Fix empty-line completion #105
base: master
Are you sure you want to change the base?
Conversation
I am using your master branch (couldn't open an issue there), and my expectation was that I would be able to see completions on a new line. I may be doing something wrong. Hope you can help Here is my config for cmp. `M.cmp = function()
Plugins:
|
I forgot to allow issues at the fork - now fixed, thanks. Can you not get completions from copilot at all, or just not automatically? I got used to having to manually ask/complete() for them, but I agree it should give suggestions on its own. I don't think I can make it work with no text written though - it triggers only when any of trigger chars are pressed. Unfortunately keyword length seems to only limit how many characters must be pressed before the completion shows in the menu, not when the completion triggers. Only trigfer char usable for this would be probably the space key, but I will try if messing with isIncomplete helps. |
It is working, just not with tab or space. It appears pressing . is what triggers the autocompletions |
I've set The main thing you were probably looking for was adding Space and Tab to the trigger chars - gets triggered immediately when there is any indentation on the new line. I'm afraid without indentation this is impossible to do (outside seeing an old completion list because of another |
There are more fixes to be done, but I will leave those just in my fork to not clutter the diff so much.
This is also not the prettiest fix, but it works. Though I do intend (when I have the time) to make it cleaner and simplify the prefix issue.
After digging into these empty line issues a little bit more, I managed to fully fix it. Here are the conclusions I've come to when figuring out what's most likely going on:
get_keyword_pattern()
returned.
-> it requied any charactercmp
seems to consider empty lines as fitting the pattern, but not indented onescmp_tabnine
didn't have this issue and it also turned out that it didn't have this method eithercmp
seems to prohibit changing the text before the cursor, where line indentation iscopilot
atribute was in a deeper nested table, so the comparator was always accessingnil