Utils: make column of convertPosition 0-based to merge it into Position

Change-Id: I239b3cb33b8ad59ac4097c919155ab5ca7d57b8e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
David Schulz
2023-05-10 09:37:25 +02:00
parent f7d46f48f8
commit 9bb126c0d6
23 changed files with 66 additions and 60 deletions

View File

@@ -1041,7 +1041,7 @@ int InternalCppCompletionAssistProcessor::startCompletionHelper()
int line = 0, column = 0;
Utils::Text::convertPosition(interface()->textDocument(), startOfExpression, &line, &column);
return startCompletionInternal(interface()->filePath(),
line, column - 1, expression, endOfExpression);
line, column, expression, endOfExpression);
}
bool InternalCppCompletionAssistProcessor::tryObjCCompletion()
@@ -1074,7 +1074,7 @@ bool InternalCppCompletionAssistProcessor::tryObjCCompletion()
int line = 0, column = 0;
Utils::Text::convertPosition(interface()->textDocument(), interface()->position(), &line,
&column);
Scope *scope = thisDocument->scopeAt(line, column - 1);
Scope *scope = thisDocument->scopeAt(line, column);
if (!scope)
return false;
@@ -1989,7 +1989,7 @@ bool InternalCppCompletionAssistProcessor::completeConstructorOrFunction(const Q
int lineSigned = 0, columnSigned = 0;
Utils::Text::convertPosition(interface()->textDocument(), interface()->position(),
&lineSigned, &columnSigned);
unsigned line = lineSigned, column = columnSigned - 1;
unsigned line = lineSigned, column = columnSigned;
// find a scope that encloses the current location, starting from the lastVisibileSymbol
// and moving outwards