Clang: Fix inserting "::" after namespace

The extra "::" is showed in the tooltip right to the completion list
item, but it was not inserted.

Change-Id: I0ad2b816c56b8e3b5ccf0643f2c1a4f2a20b8818
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2016-01-18 12:14:10 +01:00
parent 2324db9d41
commit 5691156b35
2 changed files with 17 additions and 0 deletions

View File

@@ -111,6 +111,12 @@ void ClangAssistProposalItem::applyContextualContent(TextEditor::TextEditorWidge
textToBeInserted = converter.text();
if (converter.hasPlaceholderPositions())
cursorOffset = converter.placeholderPositions().at(0) - converter.text().size();
} else if (ccr.completionKind() == CodeCompletion::NamespaceCompletionKind) {
CompletionChunksToTextConverter converter;
converter.parseChunks(ccr.chunks()); // Appends "::" after name space name
textToBeInserted = converter.text();
} else if (!ccr.text().isEmpty()) {
const TextEditor::CompletionSettings &completionSettings =
TextEditor::TextEditorSettings::instance()->completionSettings();