hinell / lsp-timeout.nvim

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

[FEAT] Ignore filetypes #10

Closed ls-devs closed 11 months ago

ls-devs commented 11 months ago

Add option to ignore filetypes

It would be great if this plugin could ignore some filetypes like NeoTree Telescope etc.. Actually if u loose focus on a window such like NeoTree Telescope , the plugin try to restart some LSP cause its found 0 servers (even if u just ALT-TAB quickly). But it needs to restart LSPs if they stopped even if focus is regained on an ignored filetype.

hinell commented 11 months ago

@ls-devs Are you requesting an option to prevent lsp-timeout from starting up servers if currently focused nvim window is in ignored list?

ls-devs commented 11 months ago

@hinell Yes. But in certains conditions :

Because actually, lsp-timeout try to restart servers if the focused window is type of neo-tree Telescope etc.. even if the LSP servers did not shutdown, because lsp-timeout do not find any active LSP in this window.

For example, if u open NeoTree and u quick ALT-TAB u can see lsp-timeout trying to restart servers at each ALT-TAB

hinell commented 11 months ago

I'm thinking about the following config design:

config.paths.include     = {}  -- autocmd patterns for files on which LSP will be started/stopped
config.paths.exclude     = {}  -- lua patterns for files which are going to be ignored by `lsp-timeout`
config.filetypes.ignore  = {}  -- like above, but for file types whole strings

Any thoughts / suggestions / objections?

ls-devs commented 11 months ago

@hinell I think codfig.filetypes.ignore = {} should be enough for the user to do what he really wants to. Not needed to add so complexity for such simple thing.

hinell commented 11 months ago

Problem with non-editable windows is fixed in v1.1.0 release.

I've made a decision to avoid extending config to keep it simple. Now, certain windows are going to be ignored. No ignore lists are used.

hinell commented 11 months ago

Should to addressed in new v1.2.0 release, checkout