Pierrad / obsidian-github-copilot

A bridge between Obsidian and Github Copilot
Apache License 2.0
55 stars 5 forks source link

Add copilot complete to suggestor instead of seperate logic. #13

Closed dmnkf closed 1 month ago

dmnkf commented 1 month ago

Is your feature request related to a problem? Please describe. Currently the complete suggestion are inline. Especially with tab being the default complete hotkey it has some weird handling of for example auto completing list elements (indent vs complete).

Describe the solution you'd like I suggest a more robust handling of copilot auto complete like done in Copilot.lua with copilot-cmp.nvim, where the completions are injected in the auto-completion of the language server.

Now Obsidian doesn't have an auto-complete like this out of the box (with exceptions of file links and tags). But there is a very popular and actively maintained plugin called various complements: https://github.com/tadashi-aikawa/obsidian-various-complements-plugin

I think shifting the completions of copilot to be part of the various complements plugin allows for the most robust handling of the plugin with little to no chance for weird prioritization or conflicts of keybindings.

I know that this is a rather big feature request but I genuinely think it would drastically improve quality of life for any potential user.

dmnkf commented 1 month ago

I just saw you use LunarVim, at least according to the initial gif in the README.

here are the specific nvim plugins I am talking about: https://github.com/zbirenbaum/copilot-cmp https://github.com/zbirenbaum/copilot.lua

Pierrad commented 1 month ago

Hi @dmnkf, thanks for your interest!

From your initial problem, I've worked on fixes and changes to have better completion system. The problem with indentation is now fixed and you can customize different keybinding for different action.

Yeah, I use LunarVim times to times, and I have, indeed, installed those copilot plugin. But in fact, I disliked the way the completion where injected in the auto-complete system. Probably because I'm more used to have the suggestion directly in the editor and being able to fully accept it or partially accept it without interfering the proposition I have on my Ctrl-space keybind.

In all cases, this feature will not be part of this plugin as it will require to build a fully auto-complete system like the one from the various complements plugin and it will only conflict with the later plugin. It will require to implement all the plugin logic in their codebase and I don't know if it's what they want.

However, if you want to work on this and take my code to implement it into the complement various plugin, feel free to do it!