summaryrefslogtreecommitdiff
path: root/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sourcekit.lua
diff options
context:
space:
mode:
Diffstat (limited to 'start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sourcekit.lua')
-rw-r--r--start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sourcekit.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sourcekit.lua b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sourcekit.lua
new file mode 100644
index 0000000..f5ce413
--- /dev/null
+++ b/start/lspconfig-0.1.8/lua/lspconfig/server_configurations/sourcekit.lua
@@ -0,0 +1,25 @@
+local util = require 'lspconfig.util'
+
+return {
+ default_config = {
+ cmd = { 'sourcekit-lsp' },
+ filetypes = { 'swift', 'c', 'cpp', 'objective-c', 'objective-cpp' },
+ root_dir = function(filename, _)
+ return util.root_pattern 'buildServer.json'(filename)
+ or util.root_pattern('*.xcodeproj', '*.xcworkspace')(filename)
+ or util.find_git_ancestor(filename)
+ -- better to keep it at the end, because some modularized apps contain multiple Package.swift files
+ or util.root_pattern('compile_commands.json', 'Package.swift')(filename)
+ end,
+ },
+ docs = {
+ description = [[
+https://github.com/apple/sourcekit-lsp
+
+Language server for Swift and C/C++/Objective-C.
+ ]],
+ default_config = {
+ root_dir = [[root_pattern("buildServer.json", "*.xcodeproj", "*.xcworkspace", ".git", "compile_commands.json", "Package.swift")]],
+ },
+ },
+}