Description
The SourceKit language server in src/lsp/server.ts has incorrect file extensions:
extensions: [".swift", ".objc", "objcpp"],
Two bugs:
".objc" is the VSCode language ID for Objective-C, not a file extension. Objective-C files use .m.
"objcpp" is the language ID for Objective-C++ and is also missing the leading dot. Objective-C++ files use .mm.
The LSP dispatcher at src/lsp/lsp.ts:261 matches via path.parse(file).ext, which returns ".m" and ".mm" respectively. Neither matches the current extension list, so SourceKit never activates for any Objective-C or Objective-C++ file.
Expected behavior
SourceKit should activate for .m (Objective-C) and .mm (Objective-C++) files in addition to .swift.
Fix
extensions: [".swift", ".m", ".mm"],
This matches the mappings already present in src/lsp/language.ts:
".m": "objective-c",
".mm": "objective-cpp",
Description
The
SourceKitlanguage server insrc/lsp/server.tshas incorrect file extensions:Two bugs:
".objc"is the VSCode language ID for Objective-C, not a file extension. Objective-C files use.m."objcpp"is the language ID for Objective-C++ and is also missing the leading dot. Objective-C++ files use.mm.The LSP dispatcher at
src/lsp/lsp.ts:261matches viapath.parse(file).ext, which returns".m"and".mm"respectively. Neither matches the current extension list, so SourceKit never activates for any Objective-C or Objective-C++ file.Expected behavior
SourceKit should activate for
.m(Objective-C) and.mm(Objective-C++) files in addition to.swift.Fix
This matches the mappings already present in
src/lsp/language.ts: