Shatur / neovim-session-manager

A simple wrapper around :mksession.
GNU General Public License v3.0
510 stars 52 forks source link

Copilot doesn't work after loading a session #68

Open D00mch opened 1 year ago

D00mch commented 1 year ago

Bug description

Copilot doesn't wokin after loading a session.

Created an issue in copilot:

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.

Recommended to go here:

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.

Steps to reproduce

Minimal configuration Disable `autoload_mode` ```lua local sconf, sessions = require("session_manager.config"), require("session_manager") sessions.setup({autoload_mode = sconf.AutoloadMode.Disabled}) ``` Setup Copilot: ```lua use { "zbirenbaum/copilot.lua", event = "VimEnter", config = function() vim.defer_fn(function() require("copilot").setup() end, 100) end, } ```

Expected behavior After I load a session, Copilot continues working.

Environment

Workaround

Have a keymap to setup copilot manually after loading a session.

Shatur commented 1 year ago

Hi! This could happen because we shutdown all LSP servers. You probably should ask copilot.lua to re-enable copilot after restarting LSP.