Clang: Add commentary about column convertion

... to/from utf8 byte offset used by Clang.

Change-Id: I294d6cd61b416e5f2d64206ee2f3f1b4a91fb1d3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-01-26 17:04:38 +01:00
parent 0c50d54da7
commit fbbdfd2444
6 changed files with 20 additions and 4 deletions

View File

@@ -348,8 +348,7 @@ ClangEditorDocumentProcessor::cursorInfo(const CppTools::CursorInfoParams &param
return defaultCursorInfoFuture();
const QTextBlock block = params.textCursor.document()->findBlockByNumber(line - 1);
const QString stringOnTheLeft = block.text().left(column);
column = stringOnTheLeft.toUtf8().size() + 1; // '+ 1' is for 1-based columns
column = Utils::clangColumn(block.text(), column);
const CppTools::SemanticInfo::LocalUseMap localUses
= CppTools::BuiltinCursorInfo::findLocalUses(params.semanticInfo.doc, line, column);