Skip to content

Rename language server to objc-clangd to fix builtin conflict#2

Open
rodrigopex wants to merge 2 commits intoAkzestia:mainfrom
rodrigopex:fix/rename-clangd-to-objc-clangd
Open

Rename language server to objc-clangd to fix builtin conflict#2
rodrigopex wants to merge 2 commits intoAkzestia:mainfrom
rodrigopex:fix/rename-clangd-to-objc-clangd

Conversation

@rodrigopex
Copy link

Summary

  • Renames the language server from clangd to objc-clangd in extension.toml and updates the error message in src/objc.rs
  • This avoids a conflict with Zed's built-in clangd language server, which was preventing this extension's language server from being used

Test plan

  • Load the extension in Zed and open an Objective-C file
  • Verify objc-clangd appears as the active language server instead of the built-in clangd

@rodrigopex rodrigopex force-pushed the fix/rename-clangd-to-objc-clangd branch from be1edcb to dcd0ea6 Compare March 9, 2026 10:37
@rodrigopex rodrigopex force-pushed the fix/rename-clangd-to-objc-clangd branch from 0a75c24 to ba1740e Compare March 9, 2026 11:03
@Akzestia
Copy link
Owner

Akzestia commented Mar 9, 2026

Hi @rodrigopex,

Thanks for opening a PR, there is indeed an issue with language server not being registered because of the Zed's built in one.

 WARN  [language::language_registry] not registering extension-provided language server LanguageServerName("clangd") for language LanguageName("Objective-C"), since a builtin language server exists with that name

However there are a couple things to consider.

1. Issue with Zed itself

When I was trying to reproduce the issue I stumbled on a weird bug. If you have Objective-C extensions already installed, when you launch Zed you will get

 WARN  [language::language_registry] not registering extension-provided language server LanguageServerName("clangd") for language LanguageName("Objective-C"), since a builtin language server exists with that name

And the language server won't be registered

image

but for some reason if you will just reinstall the extension (without leaving Zed afterwards), it will override default clangd and register the one provided by the extension.

image

2. Issues with your PR

First of all this one:

[language_servers.objcpp-clangd]
name = "objcpp-clangd"
languages = ["Objective-C", "Objective-C++"]

The Objective-C++ does literally nothing, because extension only provides

languages/Objective-C

which will only register Objective-C language

image

Coming next, can you elaborate why you decided to change this one:

    let path = worktree
           .which("clangd")
           .ok_or_else(|| "objcpp-clangd: clangd must be installed and available in PATH".to_string())?;

From my pov objcpp-clangd: ... is a little bit misleading, and in no way affecting the actions users will need to take to resolve the issue with missing language server.

And finally changes to README.md


Since Zed has a built-in clangd language server, you need to configure your settings to use objcpp-clangd for Objective-C/C++ files. Add the following to your Zed settings.json:

{
  "languages": {
    "Objective-C": {
      "language_servers": ["objcpp-clangd", "!clangd"]
    },
    "Objective-C++": {
      "language_servers": ["objcpp-clangd", "!clangd"]
    }
  }
}

If Zed doesn't recognize .m/.mm files as Objective-C, you may also need:

{
  "file_types": {
    "Objective-C": ["m", "mm"]
  }
}

As I've already mentioned previously Objective-C++ does absolutely nothing. Also there is no need for manual changes to the settings.json because the fix for the conflicting names was quite trivial and only requires to change 2 lines in extension.toml

[language_servers.objc-clangd]
name = "objc-clangd"

For the part where you added If Zed doesn't recognize .m/.mm files as Objective-C, you may also need:, can you explain why you decided to add this one, because I haven't encountered a single instance in which .m or .mm files weren't recognized by the extension, and it's practically impossible as the language config covers both of them:

name = "Objective-C"
grammar = "objc"
path_suffixes = ["mm", "m", "hh", "h"]

I'd appreciate your feedback on the matter

@Akzestia Akzestia self-requested a review March 9, 2026 16:19
@Akzestia Akzestia self-assigned this Mar 9, 2026
Copy link
Owner

@Akzestia Akzestia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comment above ^

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants