linux-cultist / venv-selector.nvim

Allows selection of python virtual environment from within neovim
MIT License
378 stars 40 forks source link

[Bug] Notification shows up twice on cached venv with copilot alongside lsp #135

Closed TroySigX closed 4 weeks ago

TroySigX commented 1 month ago

Steps to reproduce:

  1. Set option notify_user_on_venv_activation = true and enable_cached_venvs = true
  2. Open a file which has a venv activated before
  3. A notification should show up now
  4. Press some random command (e.g :VenvSelect), an identical notification shows up again.
TroySigX commented 1 month ago

I notice that the second noti only shows up when I use copilot.lua alongside lsp. So I guess that the number of times notification shows up is the number of lsps configured for the buffer?

linux-cultist commented 4 weeks ago

Your second comment was very helpful in understanding this, so thank you for that.

Yes, its notifying for each LSP configured for the buffer.

It would be better if it just notified once and listed the LSP's used for the buffer in the message.

How do the messages look for you now when its showing a second notification? I cant test since I dont have a subscription. I used to have it though but felt Chat Gpt was better. :)

TroySigX commented 4 weeks ago

I've updated with latest commit, and it looks like this: image

linux-cultist commented 4 weeks ago

Update now and see if the problem is fixed. The same notification about lsp activation is not allowed now if it occurs within 1 second of the previous one. But different notifications are still allowed within the time frame.

TroySigX commented 4 weeks ago

Fixed, thanks!