Skip to content
Ryan Olson edited this page Feb 19, 2021 · 2 revisions

Swift

Apple has recently released sourcekit-lsp, which provides LSP support for Swift and C-style languages.

Installing Server

In order to install the sourcekit-lsp language server, please follow the instructions found in the sourcekit-lsp README. Please ensure that the sourcekit-lsp in in your path.

Setup vim-lsp

Register the sourcekit-lsp yourself in your .vimrc

Installing vim-lsp-swift

Here's an example that shows how to manually set up a language server for Swift.

if executable('sourcekit-lsp')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'sourcekit-lsp',
        \ 'cmd': {server_info->['sourcekit-lsp']},
        \ 'whitelist': ['swift'],
        \ })
endif