diff options
| author | William Boman <william@redwill.se> | 2021-09-17 16:05:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-17 16:05:20 +0200 |
| commit | 9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6 (patch) | |
| tree | 58da4fff57cc3aff4380f501b1845310dff4f2e8 /lua/nvim-lsp-installer.lua | |
| parent | texlab: fix ensure_executables (diff) | |
| download | mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.gz mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.bz2 mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.lz mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.xz mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.tar.zst mason-9551bbc1e207ea9a9d436f1bf02a22afc33f6aa6.zip | |
optimize io (70%+ startup speedups) (#93)
Diffstat (limited to 'lua/nvim-lsp-installer.lua')
| -rw-r--r-- | lua/nvim-lsp-installer.lua | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/lua/nvim-lsp-installer.lua b/lua/nvim-lsp-installer.lua index c1bdabb7..d5eb66b2 100644 --- a/lua/nvim-lsp-installer.lua +++ b/lua/nvim-lsp-installer.lua @@ -1,5 +1,6 @@ local notify = require "nvim-lsp-installer.notify" local dispatcher = require "nvim-lsp-installer.dispatcher" +local process = require "nvim-lsp-installer.process" local status_win = require "nvim-lsp-installer.ui.status-win" local servers = require "nvim-lsp-installer.servers" @@ -55,18 +56,10 @@ end -- "Proxy" function for triggering attachment of LSP servers to all buffers (useful when just installed a new server -- that wasn't installed at launch) -local queued = false -function M.lsp_attach_proxy() - if queued then - return - end - queued = true - vim.schedule(function() - -- As of writing, if the lspconfig server provides a filetypes setting, it uses FileType as trigger, otherwise it uses BufReadPost - vim.cmd [[ doautoall FileType | doautoall BufReadPost ]] - queued = false - end) -end +M.lsp_attach_proxy = process.debounced(function() + -- As of writing, if the lspconfig server provides a filetypes setting, it uses FileType as trigger, otherwise it uses BufReadPost + vim.cmd [[ doautoall FileType | doautoall BufReadPost ]] +end) -- old API M.get_server = servers.get_server |
