From f81621a2e91679e3f6aacce9ec7698a6e8299159 Mon Sep 17 00:00:00 2001 From: Marin Usalj Date: Mon, 30 Mar 2020 18:52:44 +0200 Subject: Add Swift support through sourcekit-lsp This is still experimental, and requires you to have sourcekit-lsp in your PATH. You can find the binary with `xcrun --find sourcekit-lsp` --- lua/nvim_lsp/sourcekit.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lua/nvim_lsp/sourcekit.lua (limited to 'lua/nvim_lsp/sourcekit.lua') diff --git a/lua/nvim_lsp/sourcekit.lua b/lua/nvim_lsp/sourcekit.lua new file mode 100644 index 00000000..7791f7d8 --- /dev/null +++ b/lua/nvim_lsp/sourcekit.lua @@ -0,0 +1,25 @@ +local configs = require 'nvim_lsp/configs' +local util = require 'nvim_lsp/util' + +configs.sourcekit = { + default_config = { + cmd = {"xcrun", "sourcekit-lsp"}; + filetypes = {"swift"}; + root_dir = util.root_pattern("Package.swift", ".git") + }; + -- on_new_config = function(new_config) end; + -- on_attach = function(client, bufnr) end; + docs = { + package_json = "https://github.com/apple/sourcekit-lsp/blob/master/Editors/vscode/package.json"; + description = [[ +https://github.com/apple/sourcekit-lsp + +Language server for Swift and C/C++/Objective-C. + ]]; + default_config = { + root_dir = [[root_pattern("Package.swift", ".git")]]; + }; + }; +}; + +-- vim:et ts=2 sw=2 -- cgit v1.2.3-70-g09d2