Commit 98257617 authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/3.6'

 Conflicts:
	src/plugins/clangcodemodel/clangassistproposalmodel.cpp
	src/plugins/clangcodemodel/clangassistproposalmodel.h

Change-Id: Iba30d2f4d95fa0f551afe58890d15f5835dfb715
parents aa37df64 f8d4e495
......@@ -581,7 +581,8 @@ void QuickItemNodeInstance::reparent(const ObjectNodeInstance::Pointer &oldParen
}
refresh();
DesignerSupport::updateDirtyNode(quickItem());
if (quickItem()->window())
DesignerSupport::updateDirtyNode(quickItem());
if (instanceIsValidLayoutable(oldParentInstance, oldParentProperty))
oldParentInstance->refreshLayoutable();
......
......@@ -104,15 +104,19 @@ void ClangAssistProposalItem::applyContextualContent(TextEditor::TextEditorWidge
}
} else if (ccr.completionKind() == CodeCompletion::KeywordCompletionKind) {
CompletionChunksToTextConverter converter;
converter.setAddPlaceHolderPositions(true);
converter.setAddSpaces(true);
converter.setAddExtraVerticalSpaceBetweenBraces(true);
converter.setupForKeywords();
converter.parseChunks(ccr.chunks());
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();
......
......@@ -43,6 +43,7 @@ ClangAssistProposalModel::ClangAssistProposalModel(
ClangBackEnd::CompletionCorrection neededCorrection)
: m_neededCorrection(neededCorrection)
{
setDetailTextFormat(Qt::RichText);
}
bool ClangAssistProposalModel::isSortable(const QString &/*prefix*/) const
......
......@@ -101,7 +101,8 @@ QList<AssistProposalItem *> toAssistProposalItems(const CodeCompletions &complet
items.insert(name, item);
item->setText(name);
item->setOrder(ccr.priority());
QString detail = CompletionChunksToTextConverter::convertToToolTip(ccr.chunks());
QString detail
= CompletionChunksToTextConverter::convertToToolTipWithHtml(ccr.chunks());
if (!ccr.briefComment().isEmpty())
detail += QStringLiteral("\n\n") + ccr.briefComment().toString();
......
......@@ -96,6 +96,13 @@ void CompletionChunksToTextConverter::setPlaceHolderToEmphasize(int placeHolderN
m_placeHolderPositionToEmphasize = placeHolderNumber;
}
void CompletionChunksToTextConverter::setupForKeywords()
{
setAddPlaceHolderPositions(true);
setAddSpaces(true);
setAddExtraVerticalSpaceBetweenBraces(true);
}
const QString &CompletionChunksToTextConverter::text() const
{
return m_text;
......@@ -111,7 +118,7 @@ bool CompletionChunksToTextConverter::hasPlaceholderPositions() const
return m_placeholderPositions.size() > 0;
}
QString CompletionChunksToTextConverter::convertToFunctionSignature(
QString CompletionChunksToTextConverter::convertToFunctionSignatureWithHtml(
const ClangBackEnd::CodeCompletionChunks &codeCompletionChunks,
int parameterToEmphasize)
{
......@@ -119,6 +126,7 @@ QString CompletionChunksToTextConverter::convertToFunctionSignature(
converter.setAddPlaceHolderText(true);
converter.setAddResultType(true);
converter.setTextFormat(TextFormat::Html);
converter.setAddOptional(true);
converter.setEmphasizeOptional(true);
......@@ -140,7 +148,7 @@ QString CompletionChunksToTextConverter::convertToName(
return converter.text();
}
QString CompletionChunksToTextConverter::convertToToolTip(
QString CompletionChunksToTextConverter::convertToToolTipWithHtml(
const ClangBackEnd::CodeCompletionChunks &codeCompletionChunks)
{
CompletionChunksToTextConverter converter;
......@@ -148,6 +156,7 @@ QString CompletionChunksToTextConverter::convertToToolTip(
converter.setAddSpaces(true);
converter.setAddExtraVerticalSpaceBetweenBraces(true);
converter.setAddOptional(true);
converter.setTextFormat(TextFormat::Html);
converter.setEmphasizeOptional(true);
converter.setAddResultType(true);
......@@ -182,7 +191,7 @@ void CompletionChunksToTextConverter::parseDependendOnTheOptionalState(
void CompletionChunksToTextConverter::parseResultType(const Utf8String &resultTypeText)
{
if (m_addResultType)
m_text += resultTypeText.toString().toHtmlEscaped() + QChar(QChar::Space);
m_text += inDesiredTextFormat(resultTypeText) + QChar(QChar::Space);
}
void CompletionChunksToTextConverter::parseText(const Utf8String &text)
......@@ -192,14 +201,14 @@ void CompletionChunksToTextConverter::parseText(const Utf8String &text)
m_text += QChar(QChar::Space);
}
m_text += text.toString().toHtmlEscaped();
m_text += inDesiredTextFormat(text);
}
void CompletionChunksToTextConverter::wrapInCursiveTagIfOptional(
const ClangBackEnd::CodeCompletionChunk &codeCompletionChunk)
{
if (m_addOptional) {
if (m_emphasizeOptional) {
if (m_emphasizeOptional && m_textFormat == TextFormat::Html) {
if (!m_previousCodeCompletionChunk.isOptional() && codeCompletionChunk.isOptional())
m_text += QStringLiteral("<i>");
else if (m_previousCodeCompletionChunk.isOptional() && !codeCompletionChunk.isOptional())
......@@ -212,7 +221,7 @@ void CompletionChunksToTextConverter::parsePlaceHolder(
const ClangBackEnd::CodeCompletionChunk &codeCompletionChunk)
{
if (m_addPlaceHolderText) {
appendText(codeCompletionChunk.text().toString().toHtmlEscaped(),
appendText(inDesiredTextFormat(codeCompletionChunk.text()),
emphasizeCurrentPlaceHolder());
}
......@@ -287,6 +296,14 @@ void CompletionChunksToTextConverter::addExtraVerticalSpaceBetweenBraces(
}
}
QString CompletionChunksToTextConverter::inDesiredTextFormat(const Utf8String &text) const
{
if (m_textFormat == TextFormat::Html)
return text.toString().toHtmlEscaped();
else
return text.toString();
}
bool CompletionChunksToTextConverter::emphasizeCurrentPlaceHolder() const
{
if (m_addPlaceHolderPositions) {
......@@ -297,9 +314,14 @@ bool CompletionChunksToTextConverter::emphasizeCurrentPlaceHolder() const
return false;
}
void CompletionChunksToTextConverter::setTextFormat(TextFormat textFormat)
{
m_textFormat = textFormat;
}
void CompletionChunksToTextConverter::appendText(const QString &text, bool boldFormat)
{
if (boldFormat)
if (boldFormat && m_textFormat == TextFormat::Html)
m_text += QStringLiteral("<b>") + text + QStringLiteral("</b>");
else
m_text += text;
......
......@@ -47,23 +47,33 @@ class CompletionChunksToTextConverter
public:
void parseChunks(const ClangBackEnd::CodeCompletionChunks &codeCompletionChunks);
enum class TextFormat {
Plain,
Html
};
void setTextFormat(TextFormat textFormat);
void setAddPlaceHolderText(bool addPlaceHolderText);
void setAddPlaceHolderPositions(bool addPlaceHolderPositions);
void setAddResultType(bool addResultType);
void setAddSpaces(bool addSpaces);
void setAddExtraVerticalSpaceBetweenBraces(bool addExtraVerticalSpaceBetweenBraces);
void setEmphasizeOptional(bool emphasizeOptional);
void setEmphasizeOptional(bool emphasizeOptional); // Only for Html format
void setAddOptional(bool addOptional);
void setPlaceHolderToEmphasize(int placeHolderNumber);
void setupForKeywords();
const QString &text() const;
const std::vector<int> &placeholderPositions() const;
bool hasPlaceholderPositions() const;
static QString convertToFunctionSignature(const ClangBackEnd::CodeCompletionChunks &codeCompletionChunks,
int parameterToEmphasize = -1);
static QString convertToName(const ClangBackEnd::CodeCompletionChunks &codeCompletionChunks);
static QString convertToToolTip(const ClangBackEnd::CodeCompletionChunks &codeCompletionChunks);
static QString convertToKeywords(const ClangBackEnd::CodeCompletionChunks &codeCompletionChunks);
static QString convertToToolTipWithHtml(const ClangBackEnd::CodeCompletionChunks &codeCompletionChunks);
static QString convertToFunctionSignatureWithHtml(
const ClangBackEnd::CodeCompletionChunks &codeCompletionChunks,
int parameterToEmphasize = -1);
private:
void parse(const ClangBackEnd::CodeCompletionChunk &codeCompletionChunk);
void parseDependendOnTheOptionalState(const ClangBackEnd::CodeCompletionChunk &codeCompletionChunk);
......@@ -76,7 +86,8 @@ private:
void addExtraVerticalSpaceBetweenBraces();
void addExtraVerticalSpaceBetweenBraces(const ClangBackEnd::CodeCompletionChunks::iterator &);
void appendText(const QString &text, bool boldFormat = false);
QString inDesiredTextFormat(const Utf8String &text) const;
void appendText(const QString &text, bool boldFormat = false); // Boldness only in Html format
bool canAddSpace() const;
bool isNotOptionalOrAddOptionals(const ClangBackEnd::CodeCompletionChunk &codeCompletionChunk) const;
......@@ -88,6 +99,7 @@ private:
ClangBackEnd::CodeCompletionChunk m_previousCodeCompletionChunk;
QString m_text;
int m_placeHolderPositionToEmphasize = -1;
TextFormat m_textFormat = TextFormat::Plain;
bool m_addPlaceHolderText = false;
bool m_addPlaceHolderPositions = false;
bool m_addResultType = false;
......
......@@ -58,7 +58,8 @@ QString ClangFunctionHintModel::text(int index) const
{
const ClangBackEnd::CodeCompletionChunks chunks = m_functionSymbols.at(index).chunks();
const QString signatureWithEmphasizedCurrentParameter
= CompletionChunksToTextConverter::convertToFunctionSignature(chunks, m_currentArgument + 1);
= CompletionChunksToTextConverter::convertToFunctionSignatureWithHtml(chunks,
m_currentArgument + 1);
return signatureWithEmphasizedCurrentParameter;
}
......
......@@ -464,6 +464,10 @@ static QString compilerString()
#elif defined(Q_CC_GNU)
return QLatin1String("GCC " ) + QLatin1String(__VERSION__);
#elif defined(Q_CC_MSVC)
if (_MSC_VER > 1999)
return QLatin1String("MSVC <unknown>");
if (_MSC_VER >= 1900) // 1900: MSVC 2015
return QLatin1String("MSVC 2015");
if (_MSC_VER >= 1800) // 1800: MSVC 2013 (yearly release cycle)
return QLatin1String("MSVC ") + QString::number(2008 + ((_MSC_VER / 100) - 13));
if (_MSC_VER >= 1500) // 1500: MSVC 2008, 1600: MSVC 2010, ... (2-year release cycle)
......
......@@ -49,6 +49,8 @@
#include <QHBoxLayout>
#include <QPushButton>
#include <QCheckBox>
#include <QDialogButtonBox>
#include <QKeyEvent>
#include <QLabel>
#include <QFormLayout>
#include <QLineEdit>
......@@ -84,6 +86,7 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(tr("Attach to Process Not Yet Started"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_kitChooser = new DebuggerKitChooser(DebuggerKitChooser::LocalDebugging, this);
m_kitChooser->populate();
......@@ -124,19 +127,11 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
m_waitingLabel = new QLabel(QString(), this);
m_waitingLabel->setAlignment(Qt::AlignCenter);
m_watchingPushButton = new QPushButton(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
m_watchingPushButton = buttonBox->addButton(tr("Start Watching"), QDialogButtonBox::ActionRole);
m_watchingPushButton->setCheckable(true);
m_watchingPushButton->setChecked(false);
m_watchingPushButton->setEnabled(false);
m_watchingPushButton->setText(tr("Start Watching"));
m_closePushButton = new QPushButton(this);
m_closePushButton->setText(tr("Close"));
QHBoxLayout *buttonsLine = new QHBoxLayout();
buttonsLine->addSpacerItem(new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
buttonsLine->addWidget(m_watchingPushButton);
buttonsLine->addWidget(m_closePushButton);
QFormLayout *mainLayout = new QFormLayout(this);
mainLayout->addRow(new QLabel(tr("Kit: "), this), m_kitChooser);
......@@ -145,7 +140,7 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
mainLayout->addRow(m_continueOnAttachCheckBox);
mainLayout->addRow(m_waitingLabel);
mainLayout->addItem(new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
mainLayout->addRow(buttonsLine);
mainLayout->addRow(buttonBox);
setLayout(mainLayout);
connect(m_pathChooser, &Utils::PathChooser::beforeBrowsing,
......@@ -154,8 +149,7 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
this, &UnstartedAppWatcherDialog::startStopWatching);
connect(m_pathChooser, &Utils::PathChooser::pathChanged, this,
&UnstartedAppWatcherDialog::stopAndCheckExecutable);
connect(m_closePushButton, &QAbstractButton::clicked,
this, &QDialog::reject);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(&m_timer, &QTimer::timeout,
this, &UnstartedAppWatcherDialog::findProcess);
connect(m_kitChooser, &KitChooser::currentIndexChanged,
......@@ -165,6 +159,18 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
setWaitingState(checkExecutableString() ? NotWatchingState : InvalidWacherState);
}
bool UnstartedAppWatcherDialog::event(QEvent *e)
{
if (e->type() == QEvent::ShortcutOverride) {
QKeyEvent *ke = static_cast<QKeyEvent *>(e);
if (ke->key() == Qt::Key_Escape && !ke->modifiers()) {
ke->accept();
return true;
}
}
return QDialog::event(e);
}
void UnstartedAppWatcherDialog::selectExecutable()
{
QString path;
......
......@@ -64,6 +64,8 @@ public:
bool continueOnAttach() const;
void startWatching();
bool event(QEvent *) override;
signals:
void processFound();
......@@ -93,7 +95,6 @@ private:
QCheckBox *m_hideOnAttachCheckBox;
QCheckBox *m_continueOnAttachCheckBox;
QPushButton *m_watchingPushButton;
QPushButton *m_closePushButton;
ProjectExplorer::DeviceProcessItem m_process;
QTimer m_timer;
};
......
......@@ -135,6 +135,7 @@ private:
} // Anonymous
GenericProposalModel::GenericProposalModel()
: m_detailTextFormat(Qt::AutoText)
{}
GenericProposalModel::~GenericProposalModel()
......@@ -150,6 +151,16 @@ void GenericProposalModel::loadContent(const QList<AssistProposalItem *> &items)
m_idByText.insert(m_originalItems.at(i)->text(), i);
}
Qt::TextFormat GenericProposalModel::detailTextFormat() const
{
return m_detailTextFormat;
}
void GenericProposalModel::setDetailTextFormat(Qt::TextFormat detailTextFormat)
{
m_detailTextFormat = detailTextFormat;
}
void GenericProposalModel::reset()
{
m_currentItems = m_originalItems;
......
......@@ -72,12 +72,16 @@ public:
void setSortingAllowed(bool isAllowed);
bool isSortingAllowed() const;
Qt::TextFormat detailTextFormat() const;
void setDetailTextFormat(Qt::TextFormat detailTextFormat);
protected:
QList<AssistProposalItem *> m_currentItems;
private:
QHash<QString, int> m_idByText;
QList<AssistProposalItem *> m_originalItems;
Qt::TextFormat m_detailTextFormat;
};
} // TextEditor
......
......@@ -168,6 +168,11 @@ public:
m_label->setText(text);
}
void setTextFormat(Qt::TextFormat textFormat)
{
m_label->setTextFormat(textFormat);
}
// Workaround QTCREATORBUG-11653
void calculateMaximumWidth()
{
......@@ -311,6 +316,7 @@ void GenericProposalWidgetPrivate::maybeShowInfoTip()
m_infoFrame->move(m_completionListView->infoFramePos());
m_infoFrame->setText(infoTip);
m_infoFrame->setTextFormat(m_model->detailTextFormat());
m_infoFrame->calculateMaximumWidth();
m_infoFrame->adjustSize();
m_infoFrame->show();
......
......@@ -53,6 +53,7 @@ protected:
CodeCompletionChunk templateResultType{CodeCompletionChunk::ResultType, Utf8StringLiteral("Foo<int>")};
CodeCompletionChunk enumerationResultType{CodeCompletionChunk::ResultType, Utf8StringLiteral("Enumeration")};
CodeCompletionChunk functionName{CodeCompletionChunk::TypedText, Utf8StringLiteral("Function")};
CodeCompletionChunk namespaceName{CodeCompletionChunk::TypedText, Utf8StringLiteral("Namespace")};
CodeCompletionChunk variableName{CodeCompletionChunk::TypedText, Utf8StringLiteral("Variable")};
CodeCompletionChunk enumeratorName{CodeCompletionChunk::TypedText, Utf8StringLiteral("Enumerator")};
CodeCompletionChunk enumerationName{CodeCompletionChunk::TypedText, Utf8StringLiteral("Enumeration")};
......@@ -61,6 +62,7 @@ protected:
CodeCompletionChunk rightParen{CodeCompletionChunk::RightParen, Utf8StringLiteral(")")};
CodeCompletionChunk comma{CodeCompletionChunk::Comma, Utf8StringLiteral(", ")};
CodeCompletionChunk semicolon{CodeCompletionChunk::SemiColon, Utf8StringLiteral(";")};
CodeCompletionChunk colonColonText{CodeCompletionChunk::Text, Utf8StringLiteral("::")};
CodeCompletionChunk functionArgumentX{CodeCompletionChunk::Placeholder, Utf8StringLiteral("char x")};
CodeCompletionChunk functionArgumentY{CodeCompletionChunk::Placeholder, Utf8StringLiteral("int y")};
CodeCompletionChunk functionArgumentZ{CodeCompletionChunk::Placeholder, Utf8StringLiteral("int z")};
......@@ -131,7 +133,7 @@ TEST_F(CompletionChunksToTextConverter, ConvertToFunctionSignatureWithOneArgumen
using ClangCodeModel::Internal::CompletionChunksToTextConverter;
ASSERT_THAT(converter.convertToFunctionSignature(completionChunks),
ASSERT_THAT(converter.convertToFunctionSignatureWithHtml(completionChunks),
QStringLiteral("int Function(char x)"));
}
......@@ -143,7 +145,7 @@ TEST_F(CompletionChunksToTextConverter, ConvertToFunctionSignatureWithOneParamet
functionArgumentX,
rightParen});
ASSERT_THAT(converter.convertToFunctionSignature(completionChunks, 1),
ASSERT_THAT(converter.convertToFunctionSignatureWithHtml(completionChunks, 1),
QStringLiteral("int Function(<b>char x</b>)"));
}
......@@ -155,7 +157,7 @@ TEST_F(CompletionChunksToTextConverter, ConvertToFunctionSignatureWithOneParamet
functionArgumentX,
rightParen});
ASSERT_THAT(converter.convertToFunctionSignature(completionChunks, -1),
ASSERT_THAT(converter.convertToFunctionSignatureWithHtml(completionChunks, -1),
QStringLiteral("int Function(char x)"));
}
......@@ -169,7 +171,7 @@ TEST_F(CompletionChunksToTextConverter, ConvertToFunctionSignatureWithTwoParamet
functionArgumentY,
rightParen});
ASSERT_THAT(converter.convertToFunctionSignature(completionChunks, 2),
ASSERT_THAT(converter.convertToFunctionSignatureWithHtml(completionChunks, 2),
QStringLiteral("int Function(char x, <b>int y</b>)"));
}
......@@ -183,7 +185,7 @@ TEST_F(CompletionChunksToTextConverter, ConvertToFunctionSignatureWithTwoParamet
optionalFunctionArgumentY,
rightParen});
ASSERT_THAT(converter.convertToFunctionSignature(completionChunks, 2),
ASSERT_THAT(converter.convertToFunctionSignatureWithHtml(completionChunks, 2),
QStringLiteral("int Function(char x<i>, <b>int y</b></i>)"));
}
......@@ -197,7 +199,7 @@ TEST_F(CompletionChunksToTextConverter, ConvertToFunctionSignatureWithTemplateRe
using ClangCodeModel::Internal::CompletionChunksToTextConverter;
ASSERT_THAT(CompletionChunksToTextConverter::convertToFunctionSignature(completionChunks),
ASSERT_THAT(CompletionChunksToTextConverter::convertToFunctionSignatureWithHtml(completionChunks),
QStringLiteral("Foo&lt;int&gt; Function(char x)"));
}
......@@ -211,7 +213,7 @@ TEST_F(CompletionChunksToTextConverter, ConvertToFunctionSignatureWithTemplateAr
using ClangCodeModel::Internal::CompletionChunksToTextConverter;
ASSERT_THAT(CompletionChunksToTextConverter::convertToFunctionSignature(completionChunks),
ASSERT_THAT(CompletionChunksToTextConverter::convertToFunctionSignatureWithHtml(completionChunks),
QStringLiteral("int Function(const Foo&lt;int&gt; &amp;foo)"));
}
......@@ -227,7 +229,7 @@ TEST_F(CompletionChunksToTextConverter, ConvertFunctionWithOptionalParameter)
optionalFunctionArgumentZ,
rightParen});
ASSERT_THAT(Converter::convertToToolTip(completionChunks),
ASSERT_THAT(Converter::convertToToolTipWithHtml(completionChunks),
QStringLiteral("int Function (char x<i>, int y, int z</i>)"));
}
......@@ -269,7 +271,7 @@ TEST_F(CompletionChunksToTextConverter, Switch)
leftBrace,
verticalSpace,
rightBrace});
setupConverterForKeywords();
converter.setupForKeywords();
converter.parseChunks(completionChunks);
......@@ -292,7 +294,7 @@ TEST_F(CompletionChunksToTextConverter, For)
statements,
verticalSpace,
rightBrace});
setupConverterForKeywords();
converter.setupForKeywords();
converter.parseChunks(completionChunks);
......@@ -306,11 +308,11 @@ TEST_F(CompletionChunksToTextConverter, const_cast)
rightAngle,
leftParen,
rightParen});
setupConverterForKeywords();
converter.setupForKeywords();
converter.parseChunks(completionChunks);
ASSERT_THAT(converter.text(), QStringLiteral("const_cast&lt;&gt;()"));
ASSERT_THAT(converter.text(), QStringLiteral("const_cast<>()"));
}
TEST_F(CompletionChunksToTextConverter, Throw)
......@@ -333,7 +335,7 @@ TEST_F(CompletionChunksToTextConverter, ElseIf)
statements,
verticalSpace,
rightBrace});
setupConverterForKeywords();
converter.setupForKeywords();
converter.parseChunks(completionChunks);
......@@ -348,17 +350,20 @@ TEST_F(CompletionChunksToTextConverter, EnableIfT)
optionalComma,
optionalEnableIfTType,
rightAngle});
setupConverterForKeywords();
converter.setupForKeywords();
converter.parseChunks(completionChunks);
ASSERT_THAT(converter.text(), QStringLiteral("enable_if_t&lt;&gt;"));
ASSERT_THAT(converter.text(), QStringLiteral("enable_if_t<>"));
}
void CompletionChunksToTextConverter::setupConverterForKeywords()
TEST_F(CompletionChunksToTextConverter, Namespace)
{
converter.setAddPlaceHolderPositions(true);
converter.setAddSpaces(true);
converter.setAddExtraVerticalSpaceBetweenBraces(true);
CodeCompletionChunks completionChunks({namespaceName, colonColonText});
converter.parseChunks(completionChunks);
ASSERT_THAT(converter.text(), QStringLiteral("Namespace::"));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment