LanguageClient: introduce new type for gorgeous formatted errors

Change-Id: Ia76bd768bcb6d33ce66319dddf8cc355a41ffa31
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2020-02-10 10:31:32 +01:00
parent bf0f2ebea0
commit e3c7b72003
28 changed files with 323 additions and 241 deletions

View File

@@ -74,7 +74,7 @@ DidChangeTextDocumentParams::DidChangeTextDocumentParams(
setContentChanges({text});
}
bool DidChangeTextDocumentParams::isValid(QStringList *error) const
bool DidChangeTextDocumentParams::isValid(ErrorHierarchy *error) const
{
return check<VersionedTextDocumentIdentifier>(error, textDocumentKey)
&& checkArray<TextDocumentContentChangeEvent>(error, contentChangesKey);
@@ -96,7 +96,7 @@ DidChangeTextDocumentParams::TextDocumentContentChangeEvent::TextDocumentContent
setText(text);
}
bool DidChangeTextDocumentParams::TextDocumentContentChangeEvent::isValid(QStringList *error) const
bool DidChangeTextDocumentParams::TextDocumentContentChangeEvent::isValid(ErrorHierarchy *error) const
{
return checkOptional<Range>(error, rangeKey)
&& checkOptional<int>(error, rangeLengthKey)
@@ -108,7 +108,7 @@ DidSaveTextDocumentParams::DidSaveTextDocumentParams(const TextDocumentIdentifie
setTextDocument(document);
}
bool DidSaveTextDocumentParams::isValid(QStringList *error) const
bool DidSaveTextDocumentParams::isValid(ErrorHierarchy *error) const
{
return check<TextDocumentIdentifier>(error, textDocumentKey)
&& checkOptional<QString>(error, textKey);
@@ -122,13 +122,13 @@ WillSaveTextDocumentParams::WillSaveTextDocumentParams(
setReason(reason);
}
bool WillSaveTextDocumentParams::isValid(QStringList *error) const
bool WillSaveTextDocumentParams::isValid(ErrorHierarchy *error) const
{
return check<TextDocumentIdentifier>(error, textDocumentKey)
&& check<int>(error, reasonKey);
}
bool TextDocumentSaveRegistrationOptions::isValid(QStringList *error) const
bool TextDocumentSaveRegistrationOptions::isValid(ErrorHierarchy *error) const
{
return TextDocumentRegistrationOptions::isValid(error)
&& checkOptional<bool>(error, includeTextKey);