Clang: Change the way completion fix-its are shown

Move the completion information to the tooltip and
show fix-it icon on the right of such item.

Change-Id: I7eff410384104387e547695171e4864760c07fb9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-09-25 16:19:41 +02:00
parent 089b50f7d3
commit 931ec39f64
5 changed files with 121 additions and 37 deletions

View File

@@ -155,8 +155,18 @@ int clangColumn(const QTextBlock &line, int cppEditorColumn)
// (2) The return value is the column in Clang which is the utf8 byte offset from the beginning
// of the line.
// Here we convert column from (1) to (2).
// '+ 1' is for 1-based columns
return line.text().left(cppEditorColumn).toUtf8().size() + 1;
// '- 1' and '+ 1' are because of 1-based columns
return line.text().left(cppEditorColumn - 1).toUtf8().size() + 1;
}
int cppEditorColumn(const QTextBlock &line, int clangColumn)
{
// (1) clangColumn is the column in Clang which is the utf8 byte offset from the beginning
// of the line.
// (2) The return value is the actual column shown by CppEditor.
// Here we convert column from (1) to (2).
// '- 1' and '+ 1' are because of 1-based columns
return QString::fromUtf8(line.text().toUtf8().left(clangColumn - 1)).size() + 1;
}
::Utils::CodeModelIcon::Type iconTypeForToken(const ClangBackEnd::TokenInfoContainer &token)