Skip to content
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

**github co-pilot** -- MVP ok to use! #379

Closed
ms-jpq opened this issue Oct 29, 2021 · 11 comments
Closed

**github co-pilot** -- MVP ok to use! #379

ms-jpq opened this issue Oct 29, 2021 · 11 comments

Comments

@ms-jpq
Copy link
Owner

ms-jpq commented Oct 29, 2021

https://github.com/ms-jpq/coq.thirdparty

require("coq_3p") {
  { src = "copilot", short_name = "COP", tmp_accept_key = "<c-r>" }
}
@ms-jpq ms-jpq pinned this issue Oct 29, 2021
@ms-jpq
Copy link
Owner Author

ms-jpq commented Oct 29, 2021

here is a quick job on getting copilot to co-exist with coq, just got into tech preview today and will take more time to get it to work better.

It's really not ideal, right now to accept co-pilot suggestions, its an additional hotkey. Since I just got the invite to the tech preview this afternoon, I havn't figured out how to do this more elegantly, but its better than nothing.
the idea is that you can just use this, and by the time i figure it out, you can just update the git repo and everything will be done better.

@aprowe
Copy link

aprowe commented Nov 2, 2021

Im trying this out, the only issue I am running into is that if there are completion suggestions as well as a co-pilot suggestion, the co-pilot suggestion disappears after like 0.1 seconds, basically just flickers. If there are no completion suggestions, the co-pilot feature works as intended.
Thanks!

@kyrisu
Copy link

kyrisu commented Nov 4, 2021

@aprowe disabling fast_close should help. My understanding is that when the pum window is closed and reopened it re-renders the screen and hides the ghost text:

vim.g.coq_settings = {
  auto_start = true,
  display = {
    pum = {
      fast_close = false
    }
  }
}

@yingzhu146
Copy link

@kyrisu does this work for you still? for me adding your suggested settings to my init.lua doesn't help - still just flickers. @ms-jpq - again thanks a ton for this, you're a legend. any suggestions on the flicker though?

@kyrisu
Copy link

kyrisu commented Nov 23, 2021

@yingzhu146 I'm actually experiencing the same as @aprowe - with no completion suggestions copilot works as expected with then it disappears.

@yingzhu146
Copy link

yep same here!

@PlatyPew
Copy link

I'm also experiencing the same issue with the ghost text flickering, would love some suggestions @ms-jpq. Thanks for the amazing work!

@ms-jpq
Copy link
Owner Author

ms-jpq commented Jan 3, 2022

I made some updates a few days ago and it should work better now.

The issue remains that copilot is very slow compared to other completion sources and the interm solution is just to add an accept key as normal and in cases where copilot responds fast enough, it will show up in the suggestions menu.

which should be pretty similar to how VScode does it or something.

@ms-jpq ms-jpq closed this as completed Jan 3, 2022
@PlatyPew
Copy link

PlatyPew commented Jan 3, 2022

Not sure if I'm doing anything wrong but ghost text for copilot still flickers

Screen.Recording.2022-01-03.at.10.19.07.PM.mov

Here's my config:

-- coq settings
vim.g.coq_settings = {
    auto_start = 'shut-up',
    clients = {
        tabnine = {
            enabled = true,
        },
    },
    keymap = {
        recommended = false,
        jump_to_mark = '<c-e>',
    },
}

local lspconfig = require'lspconfig'
local coq = require'coq'
local coq_3p = require'coq_3p'
local lspinstall = require'nvim-lsp-installer'

-- Snippet support
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true

-- Loops through installed LSPs
lspinstall.on_server_ready(function(server)
    local config = {
        capabilities = capabilities,
        flags = { debounce_text_changes = 500 },
        on_attach = function(client)
            client.resolved_capabilities.document_formatting = false
            client.resolved_capabilities.document_range_formatting = false
        end,
    }

    server:setup(coq.lsp_ensure_capabilities(config))
end)

coq_3p{
    { src = 'copilot', short_name = 'COP', accept_key = '<C-f>' },
}

@Monirzadeh
Copy link

my config is init not lua how should that to work with copilot
for now if i active coq copilot not show any suggestion

@yavko
Copy link

yavko commented May 13, 2022

For me copilot suggestions are always there, but when i open the coq_menu they go away but its very annoying because they always cover my code
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants