Skip to content

fix(lsp): correct SourceKit extensions for Objective-C and Objective-C++ files#29315

Open
amirlankalm wants to merge 1 commit into
anomalyco:devfrom
amirlankalm:fix/sourcekit-objc-extensions
Open

fix(lsp): correct SourceKit extensions for Objective-C and Objective-C++ files#29315
amirlankalm wants to merge 1 commit into
anomalyco:devfrom
amirlankalm:fix/sourcekit-objc-extensions

Conversation

@amirlankalm
Copy link
Copy Markdown

@amirlankalm amirlankalm commented May 26, 2026

Issue for this PR

Closes #19092

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Fixes the file extensions for the SourceKit language server so it activates for Objective-C (.m) and Objective-C++ (.mm) files.

The previous values were ".objc" and "objcpp" — these are VSCode language IDs, not file extensions. "objcpp" was also missing the leading dot entirely. The LSP dispatcher at lsp/lsp.ts:261 matches via path.parse(file).ext, which returns ".m" and ".mm" respectively, so SourceKit never activated for any Objective-C or Objective-C++ file.

The one-line fix aligns the extensions with what is already in language.ts:
```
".m": "objective-c"
".mm": "objective-cpp"
```

Users hitting this bug had to work around it by manually configuring lsp.sourcekit-lsp.extensions in opencode.jsonc (as documented in #19092). This removes the need for that workaround.

How did you verify your code works?

  • Traced the dispatch path in lsp/lsp.ts: path.parse("MyClass.m").ext".m", which now matches the updated extensions list
  • Confirmed language.ts already maps .m"objective-c" and .mm"objective-cpp", so the rest of the LSP pipeline expects these extensions
  • All 15 packages pass bun turbo typecheck

Screenshots / recordings

N/A — LSP configuration change, no UI.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

SourceKit was listing ".objc" and "objcpp" (no leading dot) instead of
".m" and ".mm". The LSP dispatcher matches via path.parse(file).ext which
returns ".m" and ".mm" respectively, so SourceKit never activated for any
Objective-C or Objective-C++ file.

Closes anomalyco#29314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add built-in LSP support for Objective-C (.m, .mm, .h)

1 participant