copilot.lua icon indicating copy to clipboard operation
copilot.lua copied to clipboard

Crash on too long suggestions

Open grappas opened this issue 8 months ago • 5 comments

Vanilla LazyVim on neovim: NVIM v0.11.1 Build type: RelWithDebInfo LuaJIT 2.1.1741730670 and Arch Linux Crash on too long suggestion. No logs given during this crash, even on debug nor I can determine limit for suggestion lenght. Bug occurs not on suggestion itself but on confirmation (in LazyVim it's <Return>).

https://github.com/user-attachments/assets/a849cd38-2784-4219-8650-40fce39d36fe

grappas avatar May 14 '25 09:05 grappas

I have tried replicating and had no issues accepting suggestions that were 30 lines long (getting longer suggestions can be difficult). Do you have a minimal configuration to replicate the issue?

Something like:

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

local plugins = {
	{
		"zbirenbaum/copilot.lua",
		branch = "dev",
		opts = {
			logger = {
				file_log_level = vim.log.levels.TRACE,
			},
		},
	},
}

require("lazy.minit").repro({ spec = plugins })

AntoineGS avatar May 14 '25 19:05 AntoineGS

+1 on this - I'm running into it too. This issue started after the update to Neovim version 0.11.X, with the new lsp manager.

This is my copilot config:

return {
	-- copilot
	{
		"zbirenbaum/copilot.lua",
		cmd = "Copilot",
		build = ":Copilot auth",
		opts = {
			suggestion = { enabled = false },
			panel = { enabled = false },
			filetypes = {
				["*"] = true,
			},
			telemetry = {
                telemetryLevel = "none", -- Disable telemetry
            },
		},
	},
	-- copilot cmp source
	{
		"nvim-cmp",
		dependencies = {
			{
				"zbirenbaum/copilot-cmp",
				dependencies = "copilot.lua",
				config = function(_, opts)
					local copilot_cmp = require("copilot_cmp")
					copilot_cmp.setup(opts)
					-- attach cmp source whenever copilot attaches
					-- fixes lazy-loading issues with the copilot cmp source
					require("lazyvim.util").lsp.on_attach(function(client)
						if client.name == "copilot" then
							copilot_cmp._on_insert_enter()
						end
					end)
				end,
			},
		},
        },
}

rukmal avatar May 15 '25 13:05 rukmal

+1 on this too. Also, the completion is too slow for some reason.

Image

UPDATE

So... apparently it's a blink.cmp problem, because some were able to fix it by removing a line: https://github.com/Saghen/blink.cmp/issues/1627 https://github.com/Saghen/blink.cmp/issues/1727

azeveco avatar May 16 '25 04:05 azeveco

Ah so the ghost text is coming from blink and not this plugin! I'll keep the issue open for now in case it turns out to be something else, when the blink side is resolved please let me know if the issue is resolved :)

AntoineGS avatar May 20 '25 15:05 AntoineGS

I will, thanks @AntoineGS !

azeveco avatar May 20 '25 16:05 azeveco

Has this been fixed on the Blink side?

AntoineGS avatar Jul 31 '25 13:07 AntoineGS

It seems so. Closing for now.

grappas avatar Jul 31 '25 13:07 grappas