Skip to content

fix(lsp): SourceKit does not activate for Objective-C (.m) and Objective-C++ (.mm) files #29314

@amirlankalm

Description

@amirlankalm

Description

The SourceKit language server in src/lsp/server.ts has incorrect file extensions:

extensions: [".swift", ".objc", "objcpp"],

Two bugs:

  1. ".objc" is the VSCode language ID for Objective-C, not a file extension. Objective-C files use .m.
  2. "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",

Metadata

Metadata

Assignees

Labels

needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions