forked from qt-creator/qt-creator
Utils: remove OptionalLineColumn
LineColumn already has a isValid() that is sufficient for the use case. Change-Id: I7f6e1d64b66a9af05d74ce0ef45717265dc28ed3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -1052,12 +1052,12 @@ TextEditor::BaseTextEditor *jsonEditor()
|
||||
QJsonDocument::fromJson(content.toUtf8(), &error);
|
||||
if (error.error == QJsonParseError::NoError)
|
||||
return;
|
||||
const Utils::OptionalLineColumn lineColumn
|
||||
const Utils::LineColumn lineColumn
|
||||
= Utils::Text::convertPosition(document->document(), error.offset);
|
||||
if (!lineColumn.has_value())
|
||||
if (!lineColumn.isValid())
|
||||
return;
|
||||
auto mark = new TextMark(Utils::FilePath(),
|
||||
lineColumn->line,
|
||||
lineColumn.line,
|
||||
{::LanguageClient::Tr::tr("JSON Error"), jsonMarkId});
|
||||
mark->setLineAnnotation(error.errorString());
|
||||
mark->setColor(Utils::Theme::CodeModel_Error_TextMarkColor);
|
||||
|
||||
Reference in New Issue
Block a user