clangd / vscode-clangd

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

Does clangd support adding squiggles for unused variables and functions? #618

Closed laplacedoge closed 2 months ago

laplacedoge commented 2 months ago

Does clangd support adding squiggles for unused variables and functions?

HighCommander4 commented 2 months ago

Clangd can show whatever diagnostics the clang compiler or clang-tidy can produce on a codebase.

For unused variables and functions, have a look at https://clang.llvm.org/docs/DiagnosticsReference.html for the relevant clang compiler flags that turn them on, and https://clangd.llvm.org/installation#project-setup about how to tell clangd about compiler flags (see also https://clangd.llvm.org/config.html).

laplacedoge commented 2 months ago

Clangd can show whatever diagnostics the clang compiler or clang-tidy can produce on a codebase.

For unused variables and functions, have a look at https://clang.llvm.org/docs/DiagnosticsReference.html for the relevant clang compiler flags that turn them on, and https://clangd.llvm.org/installation#project-setup about how to tell clangd about compiler flags (see also https://clangd.llvm.org/config.html).

@HighCommander4 Really appreciate you providing this useful information. I will close this issue.