Rename lsp-config and add swift lsp
This commit is contained in:
parent
146f254d09
commit
32910375a6
2
init.lua
2
init.lua
|
|
@ -11,7 +11,7 @@ require('plugin-mappings')
|
|||
require('gopls')
|
||||
require('code-completion')
|
||||
require('commands')
|
||||
require('mason-config')
|
||||
require('lsp-config')
|
||||
require('theme-config')
|
||||
|
||||
-- General
|
||||
|
|
|
|||
|
|
@ -50,3 +50,23 @@ lspconfig.texlab.setup {}
|
|||
|
||||
-- Enable inlay hints
|
||||
vim.lsp.inlay_hint.enable(true)
|
||||
|
||||
-- Swift LSP
|
||||
local swift_lsp = vim.api.nvim_create_augroup("swift_lsp", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "swift" },
|
||||
callback = function()
|
||||
local root_dir = vim.fs.dirname(vim.fs.find({
|
||||
"Package.swift",
|
||||
".git",
|
||||
}, { upward = true })[1])
|
||||
local client = vim.lsp.start({
|
||||
name = "sourcekit-lsp",
|
||||
cmd = { "sourcekit-lsp" },
|
||||
root_dir = root_dir,
|
||||
})
|
||||
vim.lsp.buf_attach_client(0, client)
|
||||
end,
|
||||
group = swift_lsp,
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue