clang-tools  15.0.0git
Classes | Public Attributes | List of all members
clang::clangd::config::Fragment::DiagnosticsBlock Struct Reference

Controls behavior of diagnostics (errors and warnings). More...

#include <ConfigFragment.h>

Collaboration diagram for clang::clangd::config::Fragment::DiagnosticsBlock:
Collaboration graph


struct  ClangTidyBlock
 Controls how clang-tidy will run over the code base. More...
struct  IncludesBlock
 Controls IncludeCleaner diagnostics. More...

Public Attributes

std::vector< Located< std::string > > Suppress
 Diagnostic codes that should be suppressed. More...
llvm::Optional< Located< std::string > > UnusedIncludes
 Controls how clangd will correct "unnecessary #include directives. More...
IncludesBlock Includes
ClangTidyBlock ClangTidy

Detailed Description

Controls behavior of diagnostics (errors and warnings).

Definition at line 209 of file ConfigFragment.h.

Member Data Documentation

◆ ClangTidy

ClangTidyBlock clang::clangd::config::Fragment::DiagnosticsBlock::ClangTidy

Definition at line 268 of file ConfigFragment.h.

◆ Includes

IncludesBlock clang::clangd::config::Fragment::DiagnosticsBlock::Includes

Definition at line 245 of file ConfigFragment.h.

◆ Suppress

std::vector<Located<std::string> > clang::clangd::config::Fragment::DiagnosticsBlock::Suppress

Diagnostic codes that should be suppressed.

Valid values are:

  • *, to disable all diagnostics
  • diagnostic codes exposed by clangd (e.g unknown_type, -Wunused-result)
  • clang internal diagnostic codes (e.g. err_unknown_type)
  • warning categories (e.g. unused-result)
  • clang-tidy check names (e.g. bugprone-narrowing-conversions)

This is a simple filter. Diagnostics can be controlled in other ways (e.g. by disabling a clang-tidy check, or the -Wunused compile flag). This often has other advantages, such as skipping some analysis.

Definition at line 222 of file ConfigFragment.h.

◆ UnusedIncludes

llvm::Optional<Located<std::string> > clang::clangd::config::Fragment::DiagnosticsBlock::UnusedIncludes

Controls how clangd will correct "unnecessary #include directives.

clangd can warn if a header is #included but not used, and suggest removing it. Strict means a header is unused if it does not directly provide any symbol used in the file. Removing it may still break compilation if it transitively includes headers that are used. This should be fixed by including those headers directly.

Valid values are:

  • Strict
  • None

Definition at line 236 of file ConfigFragment.h.

The documentation for this struct was generated from the following file: