Skip to content

Commit

Permalink
fix: sourcekit lsp filetypes
Browse files Browse the repository at this point in the history
  • Loading branch information
amgdev9 committed Sep 13, 2024
1 parent bb682c1 commit 7bdf88d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lua/lspconfig/server_configurations/sourcekit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,23 @@ local util = require 'lspconfig.util'
return {
default_config = {
cmd = { 'sourcekit-lsp' },
filetypes = { 'swift', 'c', 'cpp', 'objective-c', 'objective-cpp' },
filetypes = { 'swift', 'objc', 'objcpp', 'c', 'cpp' },
root_dir = function(filename, _)
return util.root_pattern 'buildServer.json'(filename)
or util.root_pattern('*.xcodeproj', '*.xcworkspace')(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)
or util.find_git_ancestor(filename)
end,
get_language_id = function(_, ftype)
if ftype == "objc" then
return "objective-c"
end
if ftype == "objcpp" then
return "objective-cpp"
end
return ftype
end,
},
docs = {
description = [[
Expand Down

0 comments on commit 7bdf88d

Please sign in to comment.