Updated nvim which forced me to change the lsp config, no longer using
that plugin (which honestly wasn't doing much) and I am now using the nvim built in perfered way to config the lsps.
This commit is contained in:
parent
ca2d6550fa
commit
0a6c51ad4f
11
init.lua
11
init.lua
|
|
@ -13,7 +13,6 @@ vim.opt.rtp:prepend(lazypath)
|
|||
require("lazy").setup({
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"morhetz/gruvbox",
|
||||
"neovim/nvim-lspconfig",
|
||||
{ "nvim-telescope/telescope.nvim", dependencies = {"nvim-lua/plenary.nvim"} },
|
||||
"windwp/nvim-autopairs",
|
||||
{"sheerun/vim-polyglot", enabled=false},
|
||||
|
|
@ -49,7 +48,7 @@ require('nvim-treesitter.configs').setup {
|
|||
enable = true,
|
||||
},
|
||||
playground = {
|
||||
enabled = true,
|
||||
enabled = false,
|
||||
persist_queries = false,
|
||||
}
|
||||
}
|
||||
|
|
@ -111,8 +110,8 @@ vim.filetype.add({
|
|||
-- filetype = "odin",
|
||||
--}
|
||||
|
||||
local pipepath = vim.fn.stdpath("cache") .. "/server.pipe"
|
||||
if not vim.loop.fs_stat(pipepath) then
|
||||
vim.fn.serverstart(pipepath)
|
||||
end
|
||||
--local pipepath = vim.fn.stdpath("cache") .. "/server.pipe"
|
||||
--if not vim.loop.fs_stat(pipepath) then
|
||||
-- vim.fn.serverstart(pipepath)
|
||||
--end
|
||||
|
||||
|
|
|
|||
|
|
@ -37,39 +37,83 @@ local on_attach = function(client, bufnr)
|
|||
--vim.keymap.set('i', '<A-.>', v:lua.vim.lsp.omnifunc, bufopts)
|
||||
end
|
||||
|
||||
local lsp_flags = {
|
||||
debounce_text_changes = 150, --wtf is this
|
||||
}
|
||||
local lspconfig = require('lspconfig');
|
||||
lspconfig.zls.setup {
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
}
|
||||
lspconfig.gopls.setup{
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
}
|
||||
lspconfig.clangd.setup{
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
handlers = {
|
||||
["textDocument/publishDiagnostics"] = function(err, result, ctx, config)
|
||||
end
|
||||
--local lsp_flags = {
|
||||
-- debounce_text_changes = 150, --wtf is this
|
||||
--}
|
||||
--local lspconfig = require('lspconfig');
|
||||
--lspconfig.zls.setup {
|
||||
-- on_attach = on_attach,
|
||||
-- flags = lsp_flags,
|
||||
--}
|
||||
--lspconfig.gopls.setup{
|
||||
-- on_attach = on_attach,
|
||||
-- flags = lsp_flags,
|
||||
--}
|
||||
--lspconfig.clangd.setup{
|
||||
-- on_attach = on_attach,
|
||||
-- flags = lsp_flags,
|
||||
-- handlers = {
|
||||
-- ["textDocument/publishDiagnostics"] = function(err, result, ctx, config)
|
||||
-- end
|
||||
-- }
|
||||
--}
|
||||
--lspconfig.rust_analyzer.setup{
|
||||
-- on_attach = on_attach,
|
||||
--}
|
||||
--lspconfig.ols.setup{
|
||||
-- on_attach = on_attach,
|
||||
--}
|
||||
--lspconfig.pylsp.setup{
|
||||
-- on_attach = on_attach,
|
||||
-- flags = lsp_flags,
|
||||
--}
|
||||
--lspconfig.gdscript.setup{
|
||||
-- on_attach = on_attach,
|
||||
-- flags = lsp_flags,
|
||||
--}
|
||||
|
||||
local lsps = {
|
||||
{
|
||||
"clangd",
|
||||
{
|
||||
cmd = {
|
||||
'clangd',
|
||||
'--clang-tidy',
|
||||
},
|
||||
root_markers = { '.clangd', 'compile_commands.json' },
|
||||
filetypes = { 'c', 'cpp', 'h' },
|
||||
on_attach = on_attach,
|
||||
}
|
||||
},
|
||||
{
|
||||
"luals",
|
||||
{
|
||||
cmd = {
|
||||
'lua-language-server',
|
||||
},
|
||||
root_markers = { '.git', 'init.lua' },
|
||||
filetypes = { 'lua' },
|
||||
on_attach = on_attach,
|
||||
}
|
||||
},
|
||||
{
|
||||
"python-lsp",
|
||||
{
|
||||
cmd = {
|
||||
'pylsp'
|
||||
},
|
||||
root_markers = { '.git' },
|
||||
filetype = { 'py' },
|
||||
on_attach = on_attach,
|
||||
}
|
||||
}
|
||||
}
|
||||
lspconfig.rust_analyzer.setup{
|
||||
on_attach = on_attach,
|
||||
}
|
||||
lspconfig.ols.setup{
|
||||
on_attach = on_attach,
|
||||
}
|
||||
--lspconfig.pylyzer.setup{}
|
||||
lspconfig.pylsp.setup{
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
}
|
||||
lspconfig.gdscript.setup{
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
}
|
||||
|
||||
for _, lsp in pairs(lsps) do
|
||||
local name, config = lsp[1], lsp[2]
|
||||
vim.lsp.enable(name)
|
||||
if config then
|
||||
vim.lsp.config(name, config)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue