Skip to content

Commit

Permalink
lsp(deno): use root_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Nov 26, 2024
1 parent 50bbc43 commit ea1ae7f
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions lua/nxvim/lsp/plugins/mason/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,7 @@ mason_lspconfig.setup_handlers({
server_opts.single_file_support = false
server_opts.root_dir = lspconfig.util.root_pattern("package.json")
elseif server == "denols" then
server_opts.single_file_support = true
-- server_opts.root_dir = lspconfig.util.root_pattern("deno.jsonc") -- Pointless with sfs enabled.
server_opts.on_attach = function(client, bufnr)
if vim.fn.filereadable(vim.fn.getcwd() .. "/package.json") == 1 then
-- Stop (since it starts due to single file support) in a npm project.
client.stop(bufnr)
return
end
on_attach(client, bufnr)
end
server_opts.root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc")
elseif server == "jsonls" then
server_opts.init_options = { provideFormatter = false } -- Use prettierd as formatter.
elseif server == "zls" then
Expand Down

0 comments on commit ea1ae7f

Please sign in to comment.