-
-
Notifications
You must be signed in to change notification settings - Fork 896
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
Support for inlineCompletionProvider #4581
Comments
|
@Konubinix I did the same here https://github.com/kassick/copilot-lsp ! Let me know if you want to use some of it or contribute -- it was created as a POC at the time, and then I switched to |
@kiennq as I mentioned in the There is at least one glitch I'm aware of -- not sure if it is the same one @Konubinix ran into |
Regarding CAPF for inlineCompletions: One aspect of inline completions is that they can span multiple lines. With copilot, I did not see much of an issue -- I always get one-liners, not sure if it ever responds with longer text. On gitlab-lsp, though, some prompts resulted in multi-line code snippets (e.g. That's why I wrote a separate UI for inline completions instead of using company, even taking care to display the overlay in the correct place. When I had the completions from gitlab-lsp displayed in company, it would often look rather weird -- a very long company tooltip with a single candidate displayed on top of the preview overlay. Helm or Vertico as frontends for capf were no better. IMHO |
I think the |
I've update the code in my repo and soon I'll open a PR to lsp-mode @Konubinix If you can recall what were the issues you ran into, I could work on them before |
Rodrigo Kassick ***@***.***> writes:
I've update the code in my repo and soon I'll open a PR to lsp-mode
@Konubinix If you can recall what were the issues you ran into, I could work on them before
I will try again your repo and provide a feedback by friday. Is that
ok ?
…--
Konubinix
GPG Key : 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE 5C36 75D2 3CED 7439 106A
|
@Konubinix Actually, could you try lsp-mode from this fork ? I've extracted a Otherwise, using it is simply calling the display function. (define-key lsp-mode-map
(kbd "C-*") '("Inline Completions" . lsp-inline-completion-display))
Sure is! I'll also be testing it here in my setup; let's see if its behaving better now |
The overlay UI (default) should be in Basically, we will want to have On another note, is the entry point for inline completion mode |
@kassick : I wanted to try your code, but I cannot manage anymore to create a connection with copilot-node-server that provides inline completion. When I look at the exposed capabilities (using lsp-describe), I can only see this I created a simple lsp-client that runs the code the same way than copilot.el does (lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("node" "/home/sam/.emacs.d/.cache/copilot/lib/node_modules/copilot-node-server/copilot/dist/agent.js" "--stdio"))
:activation-fn (lambda (_ _) t)
:server-id 'copilot)) IIRC, at the time I wrote this issue, I could see inlineCompletion in the registered capabilities. I suppose it is linked to a recent update of the server. Therefore, I am unable to try your code. Sorry. |
Ack
Will do, but overall the overlay in my fork is behaving as expected.
Having the function be called on idle looks like an expected behaviour for an active Footnotes
|
@Konubinix That's weird -- I'm on version 1.41.0 of the server (the latest version, as of this reply) and I can see the expected capabilities I think I've seen something similar when the server was partially initialized (network issues; expired token, etc). If you manage to work around this server issue, let me know if the implementation in the fork is working as expected for you! |
@kiennq the PR includes a minor mode (on my default) that displays completions on idle. I also tried to make company and the online completion overlay to play nice with each other, specially with the minor mode on. It seems to be working. |
Is your feature related or already mentioned on the wishlist?
Describe your feature here.
When getting completion, I try to use only the built-in capfs mechanism. The fact that lsp-mode integrates with it is great. Unfortunately, copilot.el does not and I have capfs and the ad-hoc copilot.el stuff so far.
I just realized that under the hood, copilot.el uses an lsp server : copilot-node-server, so I tried creating the lsp-copilot.el client.
But this server provides completion using the inlineCompletionProvider capability, not the completionProvider one.
I tried using https://github.com/kassick/lsp-inline-completions there are a few glitches, but it basically works. But it still does not use the capfs. So I'm back to square one.
So, I'm wondering if we could deal with completion using inlineCompletionProvider in lsp-mode, so that simply M-TAB would work seamlessly.
Is there already some discussion on the topic?
The text was updated successfully, but these errors were encountered: