LSP configuration in Kate

Hello KDE community,
On my Fedora 41 system I set up a KDE development environment using kde-builder. Until today I had not used LSP but after reading the documentation I need to use this.
I installed the package clang18-18.1.8-5.fc41.x86_64. In the kate settings menu I noticed an item for LSP configuration. I kept this unchanged.

Unfortunately it is not working.

The command that is executed:
/usr/bin/clangd -log=error --background-index --limit-results=500
–completion-style=bundled

These are the errors:
clangd: error: unknown argument: ‘–background-index’
clangd: error: unknown argument: ‘–limit-results=500’
clangd: error: unknown argument: ‘–completion-style=bundled’

Could somebody advice how to solve these errors?

That’s super weird. clangd 18 still should have those arguments.

Just to make sure, you saw them in the Default Server Settings tab?

And they look like this?


        "c": {
            "command": ["clangd", "-log=error", "--background-index", "--limit-results=500", "--completion-style=bundled"],
            "commandDebug": ["clangd", "-log=verbose", "--background-index"],
            "url": "https://clangd.llvm.org",
            "highlightingModeRegex": "^(C|ANSI C89|Objective-C)$"
        },

        "cpp": {
            "use": "c",
            "highlightingModeRegex": "^(C\\+\\+|ISO C\\+\\+|Objective-C\\+\\+)$"
        },

Edit: Note that you do not need to copy these to the user settings.

Theis is an extract of the settings:
“c”: {
“command”: [“clangd”, “-log=error”, “–background-index”, “–limit-results=500”, “–completion-style=bundled”],
“commandDebug”: [“clangd”, “-log=verbose”, “–background-index”],
“url”: “…”,
“highlightingModeRegex”: “^(C|ANSI C89|Objective-C)$”
},
“cpp”: {
“use”: “c”,
“highlightingModeRegex”: “^(C\+\+|ISO C\+\+|Objective-C\+\+)$”
},

when pasting blocks of code please use the three backtics on their own line, and paste your stuff under it.

that way you not only preserve the formating but you don’t end up with -- turning into an m-dash, which makes it harder to read.

I figured out that I did not install the correct software. My assumption was that clang18.x86_64 contains clangd. Therefore I created a link to clang-18.

No I figured out that there is a file called clangd-linux-19.1.2.zip containing clangd. I copied this to /usr/bin and now indexing in kate is working.