From b7aa1c87883965af8364246959e7bc8dd86e57a2 Mon Sep 17 00:00:00 2001 From: Ross Barnie Date: Mon, 18 Sep 2023 16:40:08 -0700 Subject: [PATCH] fix(docs): Reduce scope of lspconfig example to quick-lint-js Fixes #909 --- .../vim/quick-lint-js.vim/doc/quick-lint-js.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plugin/vim/quick-lint-js.vim/doc/quick-lint-js.txt b/plugin/vim/quick-lint-js.vim/doc/quick-lint-js.txt index e696e89904..0681d319a3 100644 --- a/plugin/vim/quick-lint-js.vim/doc/quick-lint-js.txt +++ b/plugin/vim/quick-lint-js.vim/doc/quick-lint-js.txt @@ -213,14 +213,18 @@ module directly: > nvim_lsp.quick_lint_js.setup {} quick-lint-js is fast. To feel the speed, you might want to lint while in -insert mode. Add the following code to your |init.lua| to make JavaScript -linting as fast as possible: > +insert mode. Edit the "handlers" key in the setup function call to make +JavaScript linting as fast as possible: > - vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, { - update_in_insert = true, + require('lspconfig/quick_lint_js').setup { + handlers = { + ['textDocument/publishDiagnostics'] = vim.lsp.with( + vim.lsp.diagnostic.on_publish_diagnostics, { + update_in_insert = true + } + ) } - ) + } The `setup` function can take the following configuration options: