2025-08-01 12:52:57 +02:00
|
|
|
local lspconfig = require("lspconfig")
|
|
|
|
|
|
|
|
-- Swift LSP
|
|
|
|
lspconfig.sourcekit.setup {}
|
|
|
|
|
|
|
|
-- Go LSP
|
|
|
|
lspconfig.gopls.setup {
|
|
|
|
cmd = { "gopls" },
|
|
|
|
filetypes = { "go", "gomod" },
|
|
|
|
root_dir = lspconfig.util.root_pattern("go.mod", ".git"),
|
|
|
|
settings = {
|
|
|
|
gopls = {
|
|
|
|
analyses = { unusedparams = true },
|
|
|
|
staticcheck = true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2025-08-06 10:45:12 +02:00
|
|
|
-- ruby LSP
|
|
|
|
lspconfig.ruby_lsp.setup({
|
|
|
|
cmd = { "ruby-lsp" }, -- or provide full path if needed
|
|
|
|
filetypes = { "ruby" },
|
|
|
|
root_dir = lspconfig.util.root_pattern("Gemfile", ".git"),
|
|
|
|
})
|
|
|
|
|
2025-08-01 12:52:57 +02:00
|
|
|
-- Completion
|
|
|
|
local cmp = require("cmp")
|
|
|
|
cmp.setup({
|
|
|
|
snippet = {
|
|
|
|
expand = function(args)
|
|
|
|
vim.fn["vsnip#anonymous"](args.body)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
mapping = cmp.mapping.preset.insert({
|
|
|
|
["<Tab>"] = cmp.mapping.select_next_item(),
|
|
|
|
["<S-Tab>"] = cmp.mapping.select_prev_item(),
|
|
|
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
|
|
|
}),
|
|
|
|
sources = cmp.config.sources({
|
|
|
|
{ name = "nvim_lsp" },
|
|
|
|
{ name = "vsnip" },
|
|
|
|
}, {
|
|
|
|
{ name = "buffer" },
|
|
|
|
{ name = "path" },
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Syntastic config
|
|
|
|
vim.g.syntastic_swift_checkers = { 'swiftlint', 'swiftpm' }
|
|
|
|
|