nvim-navbuddy icon indicating copy to clipboard operation
nvim-navbuddy copied to clipboard

LspRestart causes an abnormal client list

Open timlee1128 opened this issue 2 years ago • 8 comments

I really enjoy using this plugin; it's very useful, and I appreciate the efforts of the author. However, recently I've encountered an issue. Sometimes I need to switch Python environments, and during this process, “LspRestart” gets executed.

"LspRestart" will result in new clients being created. Only by selecting the last client can it work properly, and the other clients should not appear.

Below is an example of a tsserver restart: image When I select the first client, NavBuddy doesn't respond at all. Here is my configuration: { "SmiteshP/nvim-navbuddy", dependencies = { { "SmiteshP/nvim-navbuddy", dependencies = { "SmiteshP/nvim-navic", "MunifTanjim/nui.nvim" }, opts = { lsp = { auto_attach = true, }, window = { position = { col = '50%', row = '27%' }, size = "30%", sections = { left = { size = '25%' }, mid = { size = '50%' }, right = { size = '25%', preview = 'never' } } } } } } },

timlee1128 avatar Aug 15 '23 10:08 timlee1128

Aah I see, we need to somehow detect and detach from the old lsp server 🤔

SmiteshP avatar Aug 15 '23 12:08 SmiteshP

I am not sure if this is fixed entirely - refreshing the buffer causes this: obrazek

(I refreshed it twice - each refresh duplicates the entry)

litoj avatar Aug 22 '23 09:08 litoj

By refreshing buffer, what do you mean?

SmiteshP avatar Aug 26 '23 05:08 SmiteshP

maybe :e

------------------ Original ------------------ From: Smitesh Patil @.> Date: Sat,Aug 26,2023 1:37 PM To: SmiteshP/nvim-navbuddy @.> Cc: Tim Lee @.>, Author @.> Subject: Re: [SmiteshP/nvim-navbuddy] LspRestart causes an abnormal clientlist (Issue #75)

By refreshing buffer, what do you mean?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

timlee1128 avatar Aug 26 '23 12:08 timlee1128

Reopening the same buffer with :e doesn't cause this issue for me 🤔 @timlee1128 Are you able to reproduce this?

SmiteshP avatar Aug 26 '23 16:08 SmiteshP

I use :e, yes. It happens to me independantly of the language server used.

litoj avatar Aug 26 '23 17:08 litoj

@JosefLitos Can you check if it still occurs on latest master? A few commits have been added that might have fixed this issue

SmiteshP avatar Sep 01 '23 10:09 SmiteshP

Oh, yeah, it totally works. I thought this was closed together with the commit already :D Thanks a lot!

litoj avatar Sep 01 '23 14:09 litoj