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:
David Schulz
2023-05-09 14:15:38 +02:00
parent 5b0c3258bb
commit 24aea361b7
4 changed files with 8 additions and 13 deletions

View File

@@ -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);