hinell / lsp-timeout.nvim

Start/stop LSP servers upon demand; keeps RAM usage low
Other
195 stars 6 forks source link

1.2.0 Error when neovim loses focus #15

Closed Zeioth closed 8 months ago

Zeioth commented 8 months ago

I've read TROUBLESHOOTING instructions

Summary

There seem to be a bug when the current neovim screen loses focus. screenshot_2023-10-29_20-35-20_742103937

Config

  {
    "hinell/lsp-timeout.nvim",
    dependencies={ "neovim/nvim-lspconfig" },
    event = "User BaseFile",
    init = function()
      vim.g["lsp-timeout-config"] = {
        stopTimeout = 1000,        -- Stop unused lsp servers after 1s (for testing).
        startTimeout = 2000,             -- Force server restart if nvim can't in 2s.
        silent = true,                   -- Notifications disabled
        filetypes = {                    -- Exclude servers that miss behave on LSP stop/start.
          ignore = { 'markdown', 'java' }
        },
      }
    end
  },

More info

I've tested with a few languages with the same result.

Steps to reproduce

  1. Use my config
  2. Open any file that has an active lsp client.
  3. move the mouse outside of neovim.

(it seems to be unrelated with the new option filetypes.)

Versions

NVIM v0.10.0-dev-1418+g15983cf2c6 Build type: RelWithDebInfo LuaJIT 2.1.1697887905 Run "nvim -V1 -v" for more info

Specify operating system/environment

Archlinux

hinell commented 8 months ago

@Zeioth Thanks for a speedy test! Please re-update:

cd ~/.local/share/nvim/lazy/lsp-timeout.nvim
git pull origin -f latest main
Zeioth commented 8 months ago

Ok now it works as usual. But with the next bugs:

Bug 1

The new option filetypes is not actually ignoring the language. It stop LSP even if the language is on the list.

filetypes = {
  ignore = { 'markdown', 'java' }
},

This has been tested with markdown and java.

Bug 2

On lua, it stop all except lua_ls for some reason

(pre-stop) screenshot_2023-10-29_21-02-37_179577479

(post-stop) screenshot_2023-10-29_21-01-43_316140182

This has been tested with lua.

hinell commented 8 months ago

@Zeioth Add lua files to the config first. ¯_(ツ)_/¯. Please, close if fixed.

filetypes = {
-  ignore = { 'markdown', 'java' }
+  ignore = { 'markdown', 'java', 'lua' }
},
Zeioth commented 8 months ago

No, doesn't fix it. Answer not related with my report. You can't reproduce?

@Zeioth Add lua files to the config first. ¯(ツ)/¯. Please, close if fixed.

filetypes = {
-  ignore = { 'markdown', 'java' }
+  ignore = { 'markdown', 'java', 'lua' }
},
hinell commented 8 months ago

@Zeioth If I add lua to ignored list - lsp-timeout ignores user events in buffers with specified filetype. It will NOT try to start/stop any LSP clients or anything. It works for me at in both tsx and lua files.

Upd: I've upgraded nvim to

NVIM v0.10.0-dev-8405649f92
Build type: MinSizeRel
LuaJIT 2.1.0-beta3

Have no issues.

Zeioth commented 8 months ago

After reinstalling the plugin, all works fine with my previous config. Thank you so much. Closing.