clangd / vscode-clangd

Visual Studio Code extension for clangd
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd
MIT License
594 stars 97 forks source link

Not showing ALL Errors in CXX #574

Closed levihuayuzhang closed 6 months ago

levihuayuzhang commented 6 months ago

Wondering if there has an upper limits for showing the error? I opened one file contains 56 errors but clangd only shows first 20s (in editor and problems window)

System information Clangd version (from the log, or clangd --version): 14.0.0 clangd extension version: newest stable Operating system: Ubuntu in WSL2

My arguments

"clangd.arguments": [
        "--background-index",
        "--log=verbose",
        "--pretty",
        "--all-scopes-completion",
        "--completion-style=detailed",
        "--header-insertion=iwyu",
        "--clang-tidy",
        "--j=10",
        "--pch-storage=memory",
        "--function-arg-placeholders=false",
        "--compile-commands-dir=build"
    ],

Thanks a lot.

HighCommander4 commented 6 months ago

Stopping after 20 errors is the default behaviour of the clang frontend.

You can override this using -ferror-limit=0 (see https://clang.llvm.org/docs/UsersManual.html#cmdoption-ferror-limit), which you could add to the commands clangd uses for parsing your files by adding the following to .clangd:

CompileFlags:
  Add: [-ferror-limit=0]
levihuayuzhang commented 6 months ago

Thanks a lot~