-
Notifications
You must be signed in to change notification settings - Fork 311
Servers Swift
Ryan Olson edited this page Jan 14, 2019
·
2 revisions
Apple has recently released sourcekit-lsp, which provides LSP support for Swift and C-style languages.
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.
- Install vim-lsp-swift (which automatically registers the language server for Swift) OR
- Register the
sourcekit-lspyourself in your .vimrc
Installing vim-lsp-swift
If you'd like the vim-lsp-swift plugin to register the sourcekit-lsp for you, install the vim-lsp-swift plugin:
" After vim-lsp, etc
Plug 'ryanolsonx/vim-lsp-swift'For more information, check out ryanolsonx/vim-lsp-swift.
Here's an example that shows how to manually setup 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