this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

some lsp config finagling

Seth 07b227fc 33ec23b9

+17 -33
+17 -33
nvim/lua/plugins/lsp.lua
··· 70 70 { 71 71 "williamboman/mason-lspconfig.nvim", 72 72 config = function() 73 - local if_not_deno = function(bufn) 74 - if not vim.fs.root(bufn, { "deno.json" }) then 75 - return vim.fs.root(bufn, { "package.json", "tsconfig.json", ".git" }) 73 + local function not_deno(_, bufn) 74 + local util = require("lspconfig.util") 75 + if util.root_pattern("deno.json", "deno.jsonc")(bufn) then 76 + return nil 76 77 end 78 + return util.root_pattern("package.json", "tsconfig.json", ".git")(bufn) 77 79 end 78 80 require("mason-lspconfig").setup({ 79 81 automatic_installation = true, ··· 86 88 "rust_analyzer", 87 89 "pylsp", 88 90 "yamlls", 91 + "denols", 89 92 }, 90 93 }) 91 94 LangServers.lua_ls = { ··· 93 96 Lua = { diagnostics = { globals = { "LangServers" } } }, 94 97 }, 95 98 } 99 + LangServers.vtsls = { 100 + root_dir = not_deno, 101 + single_file_support = false, 102 + } 103 + LangServers.eslint = { 104 + root_dir = not_deno, 105 + single_file_support = false, 106 + } 107 + LangServers.denols = { 108 + root_dir = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc"), 109 + } 96 110 LangServers.yamlls = { 97 111 settings = { 98 112 yaml = { ··· 114 128 }, 115 129 }, 116 130 } 117 - LangServers.eslint = { 118 - settings = { 119 - run = "onSave", 120 - }, 121 - root_dir = function(_, bufn) 122 - return if_not_deno(bufn) 123 - end, 124 - } 125 - LangServers.denols = { 126 - root_dir = function(_, bufn) 127 - return vim.fs.root(bufn, { "deno.json" }) 128 - end, 129 - } 130 - LangServers.vtsls = { 131 - root_dir = function(_, bufn) 132 - return if_not_deno(bufn) 133 - end, 134 - } 135 131 function SetupLspHandlers() 136 132 require("mason-lspconfig").setup_handlers({ 137 133 function(server_name) ··· 149 145 pattern = "ConfigLocalFinished", 150 146 callback = SetupLspHandlers, 151 147 }) 152 - 153 - -- Manually initialize openapi-language-server since it isn't part of mason or lspconfig 154 - -- vim.api.nvim_create_autocmd("FileType", { 155 - -- pattern = "yaml", 156 - -- callback = function() 157 - -- vim.lsp.start({ 158 - -- cmd = { "openapi-language-server" }, 159 - -- filetypes = { "yaml" }, 160 - -- root_dir = vim.fn.getcwd(), 161 - -- }) 162 - -- end, 163 - -- }) 164 148 end, 165 149 }, 166 150 {