Description
When configuring AFT LSP servers, defining a custom server with the same id as a built-in server appears to create multiple matching server entries instead of replacing or clearly merging with the built-in one.
Example intent:
{
"lsp": {
"servers": {
"clangd": {
"args": ["--query-driver=/path/to/arm-none-eabi-*"],
"root_markers": ["CMakeLists.txt", ".clangd", "compile_commands.json", ".git"]
}
}
}
}
Expected behavior would be that the configured clangd entry replaces or predictably merges with the built-in clangd server.
Observed behavior was that diagnostics appeared to use multiple clangd entries for the same file, with one server using the default config and another using the custom config/root markers. The workaround was to disable the built-in server and register a differently named server, for example custom-clangd.
Use case
Embedded C/C++ projects often need to customize clangd with cross-compilation arguments such as --query-driver, custom root markers, or compile-database settings. It would be cleaner if users could customize the built-in clangd server directly while keeping the canonical server id.
Current workaround:
{
"lsp": {
"disabled": ["clangd"],
"servers": {
"custom-clangd": {
"extensions": [".c", ".cc", ".cpp", ".cxx", ".h", ".hh", ".hpp", ".hxx"],
"binary": "clangd",
"args": ["--query-driver=/path/to/arm-none-eabi-*"],
"root_markers": ["CMakeLists.txt", ".clangd", "compile_commands.json", ".git"]
}
}
}
}
This works, but it feels like a workaround and makes global config project-specific. Ideally users could keep the server id as clangd and override or extend only the fields they need.
Description
When configuring AFT LSP servers, defining a custom server with the same id as a built-in server appears to create multiple matching server entries instead of replacing or clearly merging with the built-in one.
Example intent:
{ "lsp": { "servers": { "clangd": { "args": ["--query-driver=/path/to/arm-none-eabi-*"], "root_markers": ["CMakeLists.txt", ".clangd", "compile_commands.json", ".git"] } } } }Expected behavior would be that the configured
clangdentry replaces or predictably merges with the built-inclangdserver.Observed behavior was that diagnostics appeared to use multiple
clangdentries for the same file, with one server using the default config and another using the custom config/root markers. The workaround was to disable the built-in server and register a differently named server, for examplecustom-clangd.Use case
Embedded C/C++ projects often need to customize
clangdwith cross-compilation arguments such as--query-driver, custom root markers, or compile-database settings. It would be cleaner if users could customize the built-inclangdserver directly while keeping the canonical server id.Current workaround:
{ "lsp": { "disabled": ["clangd"], "servers": { "custom-clangd": { "extensions": [".c", ".cc", ".cpp", ".cxx", ".h", ".hh", ".hpp", ".hxx"], "binary": "clangd", "args": ["--query-driver=/path/to/arm-none-eabi-*"], "root_markers": ["CMakeLists.txt", ".clangd", "compile_commands.json", ".git"] } } } }This works, but it feels like a workaround and makes global config project-specific. Ideally users could keep the server id as
clangdand override or extend only the fields they need.