aboutsummaryrefslogtreecommitdiff
path: root/clangd/Protocol.h
diff options
context:
space:
mode:
Diffstat (limited to 'clangd/Protocol.h')
-rw-r--r--clangd/Protocol.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/clangd/Protocol.h b/clangd/Protocol.h
index 5e8e7b4b..9a8d4ac7 100644
--- a/clangd/Protocol.h
+++ b/clangd/Protocol.h
@@ -366,6 +366,10 @@ struct ClientCapabilities {
/// textDocument.publishDiagnostics.codeActionsInline.
bool DiagnosticFixes = false;
+ /// Whether the client accepts diagnostics with related locations.
+ /// textDocument.publishDiagnostics.relatedInformation.
+ bool DiagnosticRelatedInformation = false;
+
/// Whether the client accepts diagnostics with category attached to it
/// using the "category" extension.
/// textDocument.publishDiagnostics.categorySupport
@@ -582,6 +586,18 @@ struct DocumentSymbolParams {
};
bool fromJSON(const llvm::json::Value &, DocumentSymbolParams &);
+
+/// Represents a related message and source code location for a diagnostic.
+/// This should be used to point to code locations that cause or related to a
+/// diagnostics, e.g when duplicating a symbol in a scope.
+struct DiagnosticRelatedInformation {
+ /// The location of this related diagnostic information.
+ Location location;
+ /// The message of this related diagnostic information.
+ std::string message;
+};
+llvm::json::Value toJSON(const DiagnosticRelatedInformation &);
+
struct CodeAction;
struct Diagnostic {
/// The range at which the message applies.
@@ -601,6 +617,10 @@ struct Diagnostic {
/// The diagnostic's message.
std::string message;
+ /// An array of related diagnostic information, e.g. when symbol-names within
+ /// a scope collide all definitions can be marked via this property.
+ llvm::Optional<std::vector<DiagnosticRelatedInformation>> relatedInformation;
+
/// 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