Closed D00mch closed 1 year ago
Looks like Neovim lost track of the LSP server that Copilot starts. You should probably ask about this problem on neovim-session-manager, since they'll have better idea why this might happen.
One workaround I found is to have a keymap to setup Copilot after the session is loaded.
The nvim-session-manager author proposed:
Hi! This could happen because we shutdown all LSP servers. You probably should ask copilot.lua to re-enable copilot after restarting LSP.
Yes, I agree that copilot.lua should give a function to restart the copilot LSP server. Because switch between projects meas the whole workspace and program language changed. Any LSP server must restart.
Can you try out https://github.com/zbirenbaum/copilot.lua/pull/112 and see if that solves the issue?
@D00mch @snowair
@MunifTanjim #112
use {
"zbirenbaum/copilot.lua",
branch = "feat-smart-setup",
cmd = "Copilot",
after = "bufferline.nvim",
config = function()
vim.defer_fn(function()
require("copilot").setup()
end, 100)
end,
}
Run: Copilot auth
, get Client 5 quit with exit code 1 and signal 0
You shouldn't need vim.defer_fn
. Can you try removing that?
You shouldn't need
vim.defer_fn
. Can you try removing that?
Yeah, I works now for any session.
When I open Neovim and run the
:Copilot auth
command, I see the output[Copilot] Authenticated as GitHub user: D00mch
. I can still see the same output if I open a file with:e <path>
after loading the session.However, if I load a session with Neovim Session Manager and run the same command, I see the output
[Copilot] Not running
.