Skip to content

Commit a16beb6

Browse files
author
Francis
committed
SourceKit LSP added
1 parent 1aa899f commit a16beb6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

init.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,11 @@ require('lazy').setup({
762762
},
763763
},
764764
},
765+
sourcekit = {
766+
cmd = { 'sourcekit-lsp' },
767+
filetypes = { 'swift' },
768+
settings = {},
769+
},
765770
-- rust_analyzer = {},
766771
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
767772
--
@@ -802,6 +807,8 @@ require('lazy').setup({
802807
-- You can add other tools here that you want Mason to install
803808
-- for you, so that they are available from within Neovim.
804809
local ensure_installed = vim.tbl_keys(servers or {})
810+
-- Remove sourcekit from ensure_installed since it's locally available
811+
ensure_installed = vim.tbl_filter(function(name) return name ~= 'sourcekit' end, ensure_installed)
805812
vim.list_extend(ensure_installed, {
806813
'stylua', -- Used to format Lua code
807814
'pyright', -- Python LSP server
@@ -822,6 +829,11 @@ require('lazy').setup({
822829
end,
823830
},
824831
}
832+
833+
-- Setup SourceKit-LSP separately since it's not managed by Mason
834+
local sourcekit_config = servers.sourcekit or {}
835+
sourcekit_config.capabilities = vim.tbl_deep_extend('force', {}, capabilities, sourcekit_config.capabilities or {})
836+
require('lspconfig').sourcekit.setup(sourcekit_config)
825837
end,
826838
},
827839

0 commit comments

Comments
 (0)