leona / helix-gpt

Code assistant language server for Helix with support for Copilot/OpenAI/Codeium/Ollama
MIT License
285 stars 19 forks source link

[Request] Trigger completion also on `Ctrl-x` #8

Closed lemontheme closed 5 months ago

lemontheme commented 5 months ago

This message occurs frequently in the helix-gpt log file:

skipping |  | not in | {,(,),=,>, ,,,:,.,<,/

I'm assuming its related to what you describe in your comment on the Helix thread about how helix-gpt works.

Obviously, it makes total sense not to be sending completion requests every key press. It would be useful, however, to be able to trigger a request manually with the builtin Ctrl-x keybinding for autocompletion (which I spam all the time).

Without it, use cases like the following (i.e. code generation based on a description) remain out of reach.

# function that takes a number x and multiplies it by 2
.. def double(x [...]

Also, I imagine that the set of characters/keywords that signal sensible contexts for auto-fetching completions varies depending on programming languages.

Of course, all this depends on whether LSP servers are able to differentiate between automatic requests and manually triggered requests. Any ideas?

leona commented 5 months ago

Hey thanks for the suggestion. I've removed the check for the trigger character, which allows you to use ctrl + x now. Will be available in the next release.

leona commented 5 months ago

Added in 0.10

lemontheme commented 5 months ago

Awesome, thanks! :) I can confirm it works (minus other problems currently being debugged).