when i run :Copilot panel in nvim(v0.10+, plugged coc.nvim), i got UriError from coc.nvim:
[coc.nvim]: UnhandledRejection: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")
Error: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")
at s (~/.local/share/nvim/lazy/coc.nvim/build/index.js:26651:47)
at new f (~/.local/share/nvim/lazy/coc.nvim/build/index.js:26675:85)
at new l (~/.local/share/nvim/lazy/coc.nvim/build/index.js:26719:9)
at f.parse (~/.local/share/nvim/lazy/coc.nvim/build/index.js:26687:25)
at getUri (~/.local/share/nvim/lazy/coc.nvim/build/index.js:43859:36)
at Document.init (~/.local/share/nvim/lazy/coc.nvim/build/index.js:44027:21)
at new Document (~/.local/share/nvim/lazy/coc.nvim/build/index.js:43917:14)
at Documents._createDocument (~/.local/share/nvim/lazy/coc.nvim/build/index.js:44951:19)
at ~/.local/share/nvim/lazy/coc.nvim/build/index.js:44933:24
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
and in the panel buffer:
Synthesized ?/0 solutions (Duplicates hidden) [done]
and i try to debug the error where copilot.lua get the uri, in panel:init() doc is:
{
indentSize = 4,
insertSpaces = true,
position = {
character = 0,
line = 0
},
relativePath = "copilot.lua",
tabSize = 4,
uri = "file:///mypathto.config/.config/nvim/lua/plugins/copilot.lua",
version = 4
}
here is my copilot.lua logger config, the rest are default values
logger = {
log_to_file = true,
file = vim.fn.stdpath("log") .. "/copilot-lua.log",
file_log_level = vim.log.levels.OFF,
print_log = true,
print_log_level = vim.log.levels.WARN,
trace_lsp = "messages", -- "off" | "messages" | "verbose"
trace_lsp_progress = true,
log_lsp_messages = true,
},
i have to declear the logger, or it would raise attempt to index global 'logger' (a nil value), so i added it in should_attach function:
should_attach = function(_, _)
local logger = require('copilot.logger')
if not vim.bo.buflisted then
logger.debug("not attaching, buffer is not 'buflisted'")
return false
end
if vim.bo.buftype ~= "" then
logger.debug("not attaching, buffer 'buftype' is " .. vim.bo.buftype)
return false
end
return true
end,
:Copilot version
[Copilot.lua] Neovim 0.10.4
copilot language server 1.314.0
copilot.lua 2fe34db04570f6c47db0b752ca421a49b7357c03
Node.js 22.15.0
Language server: /home/cdcd/.local/share/nvim/lazy/copilot.lua/copilot/js/language-server.js
i have also tried copilot.vim, with the same configuration, it can run perfectly.
The uri in copilot#panel#Open(opts) is just a number: 0, when i debugged it.
I hope you can help me solve this issue. If you need any additional debugging information, I'm more than willing to provide it.
when i run :Copilot panel in nvim(v0.10+, plugged coc.nvim), i got UriError from coc.nvim:
and in the panel buffer:
and i try to debug the error where copilot.lua get the uri, in panel:init() doc is:
{ indentSize = 4, insertSpaces = true, position = { character = 0, line = 0 }, relativePath = "copilot.lua", tabSize = 4, uri = "file:///mypathto.config/.config/nvim/lua/plugins/copilot.lua", version = 4 }here is my copilot.lua logger config, the rest are default values
i have to declear the logger, or it would raise
attempt to index global 'logger' (a nil value), so i added it in should_attach function::Copilot version
i have also tried copilot.vim, with the same configuration, it can run perfectly.
The uri in copilot#panel#Open(opts) is just a number: 0, when i debugged it.
I hope you can help me solve this issue. If you need any additional debugging information, I'm more than willing to provide it.