From 1363b4f07789dcb0a6196f59d2d0ef8b7a6d15ef Mon Sep 17 00:00:00 2001 From: Garrett Dawson Date: Thu, 23 May 2024 22:49:39 -0600 Subject: [PATCH] fix: denols vs tsserver --- init.lua | 31 ++++++++++++++++++++++++------- lazy-lock.json | 3 ++- lua/custom/plugins/init.lua | 17 ----------------- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/init.lua b/init.lua index b6eff438..bc5d874d 100644 --- a/init.lua +++ b/init.lua @@ -43,6 +43,7 @@ P.S. You can delete this when you're done too. It's your config now :) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' + -- Install package manager -- https://github.com/folke/lazy.nvim -- `:help lazy.nvim.txt` for more info @@ -478,14 +479,10 @@ require('which-key').register({ -- -- If you want to override the default filetypes that your language server will attach to you can -- define the property 'filetypes' to the map in question. +-- local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, - -- tsserver = {}, - -- html = { filetypes = { 'html', 'twig', 'hbs'} }, - + tsserver = {}, + denols = {}, lua_ls = { Lua = { workspace = { checkThirdParty = false }, @@ -519,6 +516,26 @@ mason_lspconfig.setup_handlers { end } +local lspconfig = require 'lspconfig' + +lspconfig.denols.setup({ + root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc"), + init_options = { + lint = true, + unstable = false + }, +}) + +lspconfig.tsserver.setup({ + root_dir = lspconfig.util.root_pattern("package.json"), + on_attach = function(client, bufnr) + -- Disable tsserver for deno projects + if lspconfig.util.root_pattern("deno.json", "deno.jsonc")(vim.fn.getcwd()) then + client.stop() + end + end, +}) + -- [[ Configure nvim-cmp ]] -- See `:help cmp` local cmp = require 'cmp' diff --git a/lazy-lock.json b/lazy-lock.json index ca11711b..71cd20d9 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -12,6 +12,7 @@ "leap.nvim": { "branch": "main", "commit": "8f4d3ab9fe5c906c5745150191831c5ee0a427a0" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, + "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, "neogen": { "branch": "main", "commit": "6de0add4805165317ab7d3d36b5cef48b1b865f3" }, @@ -23,7 +24,7 @@ "nvim-base16.lua": { "branch": "master", "commit": "b336f40462b3ca1ad16a17c195b83731a2942d9a" }, "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, "nvim-lspconfig": { "branch": "master", "commit": "b972e7154bc94ab4ecdbb38c8edbccac36f83996" }, - "nvim-reveal": { "branch": "main", "commit": "64f63fd5e19f1ebb9368c847a16e63b175c9a9a7" }, + "nvim-reveal": { "branch": "main", "commit": "e6374179582c9905cf9ae75b288856838a03e500" }, "nvim-treesitter": { "branch": "master", "commit": "298a9dd4f8a0d95b347a7ebd301849d8b0e3917e" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "3557e41418b4a6c5b85d5d64abe94c9c50fa9b14" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "cb064386e667def1d241317deed9fd1b38f0dc2e" }, diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index f10d6be7..091804c2 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -151,23 +151,6 @@ return { end }, - { - "jay-babu/mason-null-ls.nvim", - cond = false, - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - "williamboman/mason.nvim", - "nvimtools/none-ls.nvim", - }, - config = function() - require("mason-null-ls").setup({ - ensure_installed = {}, - automatic_installation = true, - automatic_setup = false, - }) - end, - }, - { 'nvim-treesitter/nvim-treesitter', dependencies = {