diff options
| author | sigmaSd <bedisnbiba@gmail.com> | 2022-08-23 17:47:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-23 09:47:03 -0700 |
| commit | 790ca30d939af093e5e83f55e6ba9e2cbcb98585 (patch) | |
| tree | a9b3c824c6f35b6abeaab7f872f0772cc3892075 /lua | |
| parent | feat(denols): only send lsp requests to deno server (#2055) (diff) | |
| download | nvim-lspconfig-790ca30d939af093e5e83f55e6ba9e2cbcb98585.tar nvim-lspconfig-790ca30d939af093e5e83f55e6ba9e2cbcb98585.tar.gz nvim-lspconfig-790ca30d939af093e5e83f55e6ba9e2cbcb98585.tar.bz2 nvim-lspconfig-790ca30d939af093e5e83f55e6ba9e2cbcb98585.tar.lz nvim-lspconfig-790ca30d939af093e5e83f55e6ba9e2cbcb98585.tar.xz nvim-lspconfig-790ca30d939af093e5e83f55e6ba9e2cbcb98585.tar.zst nvim-lspconfig-790ca30d939af093e5e83f55e6ba9e2cbcb98585.zip | |
fix(denols): revert "remove unneeded lsp attach" #2070
I found the root cause of denols problems:
https://github.com/neovim/neovim/pull/19797
With that pr applied (and with this revert) denols works perfectly
almost identical to vscode deno, its missing some features but I imagine
those are out of scope for lspconfig.
Problems will reappear until nvim fixes:
https://github.com/neovim/nvim-lspconfig/issues/1998
This is an ok tradeoff because `single_file_support=true`
causes other issues:
https://github.com/neovim/nvim-lspconfig/issues/2069
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/server_configurations/denols.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lua/lspconfig/server_configurations/denols.lua b/lua/lspconfig/server_configurations/denols.lua index e8e2688d..1986a3ec 100644 --- a/lua/lspconfig/server_configurations/denols.lua +++ b/lua/lspconfig/server_configurations/denols.lua @@ -8,7 +8,7 @@ local function buf_cache(bufnr, client) client.request_sync('deno/cache', params) end -local function virtual_text_document_handler(uri, res) +local function virtual_text_document_handler(uri, res, client) if not res then return nil end @@ -25,6 +25,7 @@ local function virtual_text_document_handler(uri, res) vim.api.nvim_buf_set_option(bufnr, 'readonly', true) vim.api.nvim_buf_set_option(bufnr, 'modified', false) vim.api.nvim_buf_set_option(bufnr, 'modifiable', false) + lsp.buf_attach_client(bufnr, client.id) end local function virtual_text_document(uri, client) @@ -34,7 +35,7 @@ local function virtual_text_document(uri, client) }, } local result = client.request_sync('deno/virtualTextDocument', params) - virtual_text_document_handler(uri, result) + virtual_text_document_handler(uri, result, client) end local function denols_handler(err, result, ctx) @@ -58,8 +59,6 @@ end return { default_config = { cmd = { 'deno', 'lsp' }, - -- single file support is required for now to make the lsp work correctly, see #2000 - single_file_support = true, filetypes = { 'javascript', 'javascriptreact', |
