wtf is going on with the LSPs?
This commit is contained in:
parent
bb3f8e2914
commit
b27b25441c
23
init.lua
23
init.lua
|
@ -15,6 +15,11 @@ if not vim.loop.fs_stat(lazypath) then
|
|||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local get_root_dir = function(fname)
|
||||
local util = require("lspconfig.util")
|
||||
return util.root_pattern(".git")(fname) or util.root_pattern("package.json", "tsconfig.json")(fname)
|
||||
end
|
||||
|
||||
require('lazy').setup({
|
||||
-- Git related plugins
|
||||
'tpope/vim-fugitive',
|
||||
|
@ -38,6 +43,17 @@ require('lazy').setup({
|
|||
-- NOTE(taras) WTF is this
|
||||
'folke/neodev.nvim',
|
||||
},
|
||||
opts = {
|
||||
servers = {
|
||||
eslint = {
|
||||
root_dir = get_root_dir,
|
||||
},
|
||||
tsserver = {
|
||||
root_dir = get_root_dir,
|
||||
single_file_support = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -386,8 +402,10 @@ local servers = {
|
|||
gopls = {},
|
||||
pyright = {},
|
||||
rust_analyzer = {},
|
||||
tsserver = { single_file_support = false },
|
||||
eslint = { filetypes = { 'javascript', 'typescript', 'typescriptreact' } },
|
||||
tsserver = {},
|
||||
eslint = {
|
||||
filetypes = { 'javascript', 'typescript', 'typescriptreact' },
|
||||
},
|
||||
html = { filetypes = { 'html', 'twig', 'hbs' } },
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
|
@ -418,7 +436,6 @@ mason_lspconfig.setup_handlers {
|
|||
on_attach = on_attach,
|
||||
settings = servers[server_name],
|
||||
filetypes = (servers[server_name] or {}).filetypes,
|
||||
single_file_support = (servers[server_name] or {}).single_file_support,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue