Skip to content

Commit

Permalink
fix(denols): jumping to definition then returning breaks lsp #2000
Browse files Browse the repository at this point in the history
- remove unneeded lsp attach
- default to single_file_support=true

fix #1998
  • Loading branch information
sigmaSd authored Jul 17, 2022
1 parent 026389c commit 5d77a4e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/lspconfig/server_configurations/denols.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ local function virtual_text_document_handler(uri, result)
return nil
end

for client_id, res in pairs(result) do
for _, res in pairs(result) do
-- Error might be present because of race, deno server will eventually send a result. #1995
if res.error ~= nil then
require('vim.lsp.log').warn(
Expand All @@ -32,7 +32,6 @@ local function virtual_text_document_handler(uri, result)
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
end
end
Expand Down Expand Up @@ -67,6 +66,8 @@ 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',
Expand Down

0 comments on commit 5d77a4e

Please sign in to comment.