clang-tools 20.0.0git
Public Attributes | List of all members
clang::clangd::Diagnostic Struct Reference

#include <Protocol.h>

Public Attributes

Range range
 The range at which the message applies.
 
int severity = 0
 The diagnostic's severity.
 
std::string code
 The diagnostic's code. Can be omitted.
 
std::optional< CodeDescriptioncodeDescription
 An optional property to describe the error code.
 
std::string source
 A human-readable string describing the source of this diagnostic, e.g.
 
std::string message
 The diagnostic's message.
 
llvm::SmallVector< DiagnosticTag, 1 > tags
 Additional metadata about the diagnostic.
 
std::optional< std::vector< DiagnosticRelatedInformation > > relatedInformation
 An array of related diagnostic information, e.g.
 
std::optional< std::string > category
 The diagnostic's category.
 
std::optional< std::vector< CodeAction > > codeActions
 Clangd extension: code actions related to this diagnostic.
 
llvm::json::Object data
 A data entry field that is preserved between a textDocument/publishDiagnostics notification and textDocument/codeAction request.
 

Detailed Description

Definition at line 920 of file Protocol.h.

Member Data Documentation

◆ category

std::optional<std::string> clang::clangd::Diagnostic::category

The diagnostic's category.

Can be omitted. An LSP extension that's used to send the name of the category over to the client. The category typically describes the compilation stage during which the issue was produced, e.g. "Semantic Issue" or "Parse Issue".

Definition at line 952 of file Protocol.h.

Referenced by clang::clangd::fromJSON(), and clang::clangd::toLSPDiags().

◆ code

std::string clang::clangd::Diagnostic::code

The diagnostic's code. Can be omitted.

Definition at line 929 of file Protocol.h.

Referenced by clang::clangd::fromJSON(), and clang::clangd::toLSPDiags().

◆ codeActions

std::optional<std::vector<CodeAction> > clang::clangd::Diagnostic::codeActions

Clangd extension: code actions related to this diagnostic.

Only with capability textDocument.publishDiagnostics.codeActionsInline. (These actions can also be obtained using textDocument/codeAction).

Definition at line 957 of file Protocol.h.

◆ codeDescription

std::optional<CodeDescription> clang::clangd::Diagnostic::codeDescription

An optional property to describe the error code.

Definition at line 932 of file Protocol.h.

Referenced by clang::clangd::toLSPDiags().

◆ data

llvm::json::Object clang::clangd::Diagnostic::data

A data entry field that is preserved between a textDocument/publishDiagnostics notification and textDocument/codeAction request.

Mutating users should associate their data with a unique key they can use to retrieve later on.

Definition at line 964 of file Protocol.h.

Referenced by clang::clangd::fromJSON(), and clang::clangd::toLSPDiags().

◆ message

std::string clang::clangd::Diagnostic::message

The diagnostic's message.

Definition at line 939 of file Protocol.h.

Referenced by clang::clangd::fromJSON(), and clang::clangd::toLSPDiags().

◆ range

Range clang::clangd::Diagnostic::range

The range at which the message applies.

Definition at line 922 of file Protocol.h.

Referenced by clang::clangd::fromJSON(), and clang::clangd::toLSPDiags().

◆ relatedInformation

std::optional<std::vector<DiagnosticRelatedInformation> > clang::clangd::Diagnostic::relatedInformation

An array of related diagnostic information, e.g.

when symbol-names within a scope collide all definitions can be marked via this property.

Definition at line 946 of file Protocol.h.

Referenced by clang::clangd::toLSPDiags().

◆ severity

int clang::clangd::Diagnostic::severity = 0

The diagnostic's severity.

Can be omitted. If omitted it is up to the client to interpret diagnostics as error, warning, info or hint.

Definition at line 926 of file Protocol.h.

Referenced by clang::clangd::fromJSON(), and clang::clangd::toLSPDiags().

◆ source

std::string clang::clangd::Diagnostic::source

A human-readable string describing the source of this diagnostic, e.g.

'typescript' or 'super lint'.

Definition at line 936 of file Protocol.h.

Referenced by clang::clangd::fromJSON(), and clang::clangd::toLSPDiags().

◆ tags

llvm::SmallVector<DiagnosticTag, 1> clang::clangd::Diagnostic::tags

Additional metadata about the diagnostic.

Definition at line 942 of file Protocol.h.

Referenced by clang::clangd::toLSPDiags().


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