0

vscode clangd not can't find clangd even though path is specified.

I have installed the clangd extension in vscode and in its settings have specified the path to the clangd executable on my computer. Which is located in /nvim-data/mason/packages/clangd/bin.

When I try to run clangd commands from the command pallete errors like "command 'clangd.update' not found" pop up.

Idk what to do... Also there should be clangd info on the status bar but for me there isn't.

rioV8
  • 24,506
  • 3
  • 32
  • 49
narcomoeba
  • 21
  • 4

1 Answers1

0

I had to put clangd commands in a *.code-workspace file for it to work. Here's my file contents. It's for Windows but you should be able to adapt it:

{
"folders": [
    {
        "name": "FPS5_2",
        "path": "."
    },
    {
        "name": "UE5",
        "path": "E:\\Program Files\\Epic Games\\UE_5.2"
    }
],
"settings": {
    "typescript.tsc.autoDetect": "off",
    "editor.inlayHints.fontSize": 0,
    "clangd.detectExtensionConflicts": false,
    "clangd.arguments": [
        "-header-insertion=iwyu",
        "-header-insertion-decorators=true",
        "-all-scopes-completion=true",
        "-limit-results=100",
        "-background-index=true",
        "-limit-references=2000",
        "-completion-style=detailed",
        "-compile-commands-dir=e:\\Users\\ME\\Documents\\Unreal Projects\\FPS5_2\\.vscode\\unreal-clangd"
    ],
    "clangd.path": "c:\\Program Files\\LLVM-15\\bin\\clangd.exe",
    "files.associations": {
        "*.clangd": "yaml",
        "*.clang-format": "yaml",
        "*.clang-tidy": "yaml"
    },
    "workbench.colorCustomizations": {
        "editorInlayHint.foreground": "#a2a2a2c0",
        "editorInlayHint.background": "#00000000"
    },
    "editor.suggestFontSize": 0
},
"extensions": {
    "recommendations": [
        "ms-vscode.cpptools",
        "ms-dotnettools.csharp"
    ]
}

}

boocs
  • 456
  • 1
  • 3
  • 5
  • Thanks, it finally works now. This was my first ever question on stackoverflow was a bit hesitant to use stackoverflow cause people say its toxic but you are really nice tnx. – narcomoeba May 23 '23 at 17:57