diff options
Diffstat (limited to 'lsp/eslint.lua')
| -rw-r--r-- | lsp/eslint.lua | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lsp/eslint.lua b/lsp/eslint.lua index 104b8d4a..61c00e0a 100644 --- a/lsp/eslint.lua +++ b/lsp/eslint.lua @@ -48,12 +48,9 @@ return { 'astro', }, workspace_required = true, - on_attach = function(client) + on_attach = function(client, bufnr) vim.api.nvim_buf_create_user_command(0, 'LspEslintFixAll', function() - local bufnr = vim.api.nvim_get_current_buf() - - client:exec_cmd({ - title = 'Fix all Eslint errors for current buffer', + client:request_sync('workspace/executeCommand', { command = 'eslint.applyAllFixes', arguments = { { @@ -61,7 +58,7 @@ return { version = lsp.util.buf_versions[bufnr], }, }, - }, { bufnr = bufnr }) + }, nil, bufnr) end, {}) end, -- https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats |
