Commit 78db7d7e authored by Ivan Donchevskii's avatar Ivan Donchevskii

Clang: turn off delayed template parsing

Fix templates highlight and completion on Windows
Add UI to turn on/off delayed parsing (off by default)

Task-number: QTCREATORBUG-17222
Change-Id: I0cd5e0bcfff2789cd938e4096829f777ff15957a
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent 0784dd20
......@@ -419,16 +419,24 @@ static QStringList warningOptions(CppTools::ProjectPart *projectPart)
{
if (projectPart && projectPart->project) {
ClangProjectSettings projectSettings(projectPart->project);
if (!projectSettings.useGlobalWarningConfig()) {
if (!projectSettings.useGlobalConfig()) {
const Core::Id warningConfigId = projectSettings.warningConfigId();
const CppTools::ClangDiagnosticConfigsModel configsModel(
CppTools::codeModelSettings()->clangCustomDiagnosticConfigs());
if (configsModel.hasConfigWithId(warningConfigId))
return configsModel.configWithId(warningConfigId).commandLineOptions();
return configsModel.configWithId(warningConfigId).commandLineWarnings();
}
}
return CppTools::codeModelSettings()->clangDiagnosticConfig().commandLineOptions();
return CppTools::codeModelSettings()->clangDiagnosticConfig().commandLineWarnings();
}
static QStringList commandLineOptions(CppTools::ProjectPart *projectPart)
{
if (!projectPart || !projectPart->project)
return ClangProjectSettings::globalCommandLineOptions();
return ClangProjectSettings{projectPart->project}.commandLineOptions();
}
static QStringList precompiledHeaderOptions(
......@@ -454,6 +462,7 @@ static QStringList fileArguments(const QString &filePath, CppTools::ProjectPart
{
return languageOptions(filePath, projectPart)
+ warningOptions(projectPart)
+ commandLineOptions(projectPart)
+ precompiledHeaderOptions(filePath, projectPart);
}
......
......@@ -25,15 +25,23 @@
#include "clangprojectsettings.h"
#include <utils/qtcassert.h>
#include <utils/hostosinfo.h>
#include <QDebug>
namespace ClangCodeModel {
namespace Internal {
static QString useGlobalWarningConfigKey()
{ return QStringLiteral("ClangCodeModel.UseGlobalWarningConfig"); }
static QString useGlobalConfigKey()
{ return QStringLiteral("ClangCodeModel.UseGlobalConfig"); }
static QString warningConfigIdKey()
{ return QStringLiteral("ClangCodeModel.WarningConfigId"); }
static QString customCommandLineKey()
{ return QLatin1String("ClangCodeModel.CustomCommandLineKey"); }
ClangProjectSettings::ClangProjectSettings(ProjectExplorer::Project *project)
: m_project(project)
{
......@@ -55,31 +63,55 @@ void ClangProjectSettings::setWarningConfigId(const Core::Id &customConfigId)
m_warningConfigId = customConfigId;
}
bool ClangProjectSettings::useGlobalWarningConfig() const
bool ClangProjectSettings::useGlobalConfig() const
{
return m_useGlobalConfig;
}
void ClangProjectSettings::setUseGlobalConfig(bool useGlobalConfig)
{
return m_useGlobalWarningConfig;
m_useGlobalConfig = useGlobalConfig;
}
void ClangProjectSettings::setUseGlobalWarningConfig(bool useGlobalWarningConfig)
QStringList ClangProjectSettings::commandLineOptions() const
{
m_useGlobalWarningConfig = useGlobalWarningConfig;
return m_useGlobalConfig ? globalCommandLineOptions()
: m_customCommandLineOptions;
}
void ClangProjectSettings::setCommandLineOptions(const QStringList &options)
{
QTC_ASSERT(!m_useGlobalConfig, qDebug()
<< "setCommandLineOptions was called while using global project config");
m_customCommandLineOptions = options;
}
void ClangProjectSettings::load()
{
const QVariant useGlobalConfigVariant = m_project->namedSettings(useGlobalWarningConfigKey());
const QVariant useGlobalConfigVariant = m_project->namedSettings(useGlobalConfigKey());
const bool useGlobalConfig = useGlobalConfigVariant.isValid()
? useGlobalConfigVariant.toBool()
: true;
setUseGlobalWarningConfig(useGlobalConfig);
setUseGlobalConfig(useGlobalConfig);
setWarningConfigId(Core::Id::fromSetting(m_project->namedSettings(warningConfigIdKey())));
m_customCommandLineOptions = m_project->namedSettings(customCommandLineKey()).toStringList();
if (m_customCommandLineOptions.empty())
m_customCommandLineOptions = globalCommandLineOptions();
}
void ClangProjectSettings::store()
{
m_project->setNamedSettings(useGlobalWarningConfigKey(), useGlobalWarningConfig());
m_project->setNamedSettings(useGlobalConfigKey(), useGlobalConfig());
m_project->setNamedSettings(warningConfigIdKey(), warningConfigId().toSetting());
m_project->setNamedSettings(customCommandLineKey(), m_customCommandLineOptions);
}
QStringList ClangProjectSettings::globalCommandLineOptions()
{
if (Utils::HostOsInfo::isWindowsHost())
return {QLatin1String{GlobalWindowsCmdOptions}};
return {};
}
} // namespace Internal
......
......@@ -39,21 +39,32 @@ class ClangProjectSettings: public QObject
Q_OBJECT
public:
constexpr static const char* DelayedTemplateParsing = "-fdelayed-template-parsing";
constexpr static const char* NoDelayedTemplateParsing = "-fno-delayed-template-parsing";
constexpr static const char* GlobalWindowsCmdOptions = NoDelayedTemplateParsing;
ClangProjectSettings(ProjectExplorer::Project *project);
bool useGlobalWarningConfig() const;
void setUseGlobalWarningConfig(bool useGlobalWarningConfig);
bool useGlobalConfig() const;
void setUseGlobalConfig(bool useGlobalConfig);
Core::Id warningConfigId() const;
void setWarningConfigId(const Core::Id &warningConfigId);
QStringList commandLineOptions() const;
void setCommandLineOptions(const QStringList &options);
void load();
void store();
static QStringList globalCommandLineOptions();
private:
ProjectExplorer::Project *m_project;
bool m_useGlobalWarningConfig = true;
bool m_useGlobalConfig = true;
Core::Id m_warningConfigId;
QStringList m_customCommandLineOptions;
};
} // namespace Internal
......
......@@ -34,60 +34,21 @@
#include <cpptools/cppcodemodelsettings.h>
#include <cpptools/cpptoolsreuse.h>
static const char GLOBAL_PROXY_CONFIG_ID[] = "globalProxyConfig";
#include <utils/hostosinfo.h>
namespace ClangCodeModel {
namespace Internal {
static CppTools::ClangDiagnosticConfig
createConfigRepresentingGlobalSetting(const CppTools::ClangDiagnosticConfig &baseConfig)
static Core::Id configIdForProject(ClangProjectSettings &projectSettings)
{
CppTools::ClangDiagnosticConfig config = baseConfig;
config.setId(GLOBAL_PROXY_CONFIG_ID);
QString displayName = config.displayName();
if (config.isReadOnly())
displayName = CppTools::ClangDiagnosticConfigsModel::displayNameWithBuiltinIndication(config);
displayName = ClangProjectSettingsWidget::tr("Global setting (%1)").arg(displayName);
config.setDisplayName(displayName);
config.setIsReadOnly(true);
return config;
}
static Core::Id globalConfigId(const CppTools::CppCodeModelSettings &settings,
const CppTools::ClangDiagnosticConfigsModel &model)
{
const Core::Id configId = settings.clangDiagnosticConfigId();
if (model.hasConfigWithId(configId))
return configId;
return model.at(0).id(); // Config saved in the settings was removed, fallback to first.
}
static CppTools::ClangDiagnosticConfigsModel
createConfigsModelWithGlobalProxyConfig(const CppTools::CppCodeModelSettings &settings)
{
using namespace CppTools;
ClangDiagnosticConfigsModel configsModel(settings.clangCustomDiagnosticConfigs());
const Core::Id globalId = globalConfigId(settings, configsModel);
const ClangDiagnosticConfig globalConfig = configsModel.configWithId(globalId);
const ClangDiagnosticConfig globalProxy
= createConfigRepresentingGlobalSetting(globalConfig);
configsModel.prepend(globalProxy);
return configsModel;
}
static Core::Id configIdForProject(const ClangProjectSettings &projectSettings)
{
return projectSettings.useGlobalWarningConfig()
? Core::Id(GLOBAL_PROXY_CONFIG_ID)
: projectSettings.warningConfigId();
if (projectSettings.useGlobalConfig())
return CppTools::codeModelSettings()->clangDiagnosticConfigId();
Core::Id configId = projectSettings.warningConfigId();
if (!configId.isValid()) {
configId = CppTools::codeModelSettings()->clangDiagnosticConfigId();
projectSettings.setWarningConfigId(configId);
}
return configId;
}
ClangProjectSettingsWidget::ClangProjectSettingsWidget(ProjectExplorer::Project *project)
......@@ -98,24 +59,33 @@ ClangProjectSettingsWidget::ClangProjectSettingsWidget(ProjectExplorer::Project
using namespace CppTools;
m_diagnosticConfigWidget = new ClangDiagnosticConfigsWidget;
m_diagnosticConfigWidget->setConfigWithUndecoratedDisplayName(Core::Id(GLOBAL_PROXY_CONFIG_ID));
refreshDiagnosticConfigsWidgetFromSettings();
m_ui.generalConfigurationGroupBox->setVisible(Utils::HostOsInfo::isWindowsHost());
m_ui.clangSettings->setCurrentIndex(m_projectSettings.useGlobalConfig() ? 0 : 1);
syncOtherWidgetsToComboBox();
connectToCppCodeModelSettingsChanged();
connect(m_diagnosticConfigWidget.data(), &ClangDiagnosticConfigsWidget::currentConfigChanged,
this, &ClangProjectSettingsWidget::onCurrentWarningConfigChanged);
connect(m_diagnosticConfigWidget.data(), &ClangDiagnosticConfigsWidget::customConfigsChanged,
this, &ClangProjectSettingsWidget::onCustomWarningConfigsChanged);
connect(m_ui.delayedTemplateParse, &QCheckBox::toggled,
this, &ClangProjectSettingsWidget::onDelayedTemplateParseClicked);
connect(m_ui.clangSettings,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &ClangProjectSettingsWidget::onClangSettingsChanged);
m_ui.diagnosticConfigurationGroupBox->layout()->addWidget(m_diagnosticConfigWidget);
}
void ClangProjectSettingsWidget::onCurrentWarningConfigChanged(const Core::Id &currentConfigId)
{
const bool useGlobalConfig = currentConfigId == Core::Id(GLOBAL_PROXY_CONFIG_ID);
m_projectSettings.setUseGlobalWarningConfig(useGlobalConfig);
// Don't save it when we reset the global config in code
if (m_projectSettings.useGlobalConfig())
return;
m_projectSettings.setWarningConfigId(currentConfigId);
m_projectSettings.store();
}
......@@ -132,11 +102,48 @@ void ClangProjectSettingsWidget::onCustomWarningConfigsChanged(
connectToCppCodeModelSettingsChanged();
}
void ClangProjectSettingsWidget::onDelayedTemplateParseClicked(bool checked)
{
// Don't save it when we reset the global config in code
if (m_projectSettings.useGlobalConfig())
return;
const QLatin1String extraFlag{checked ? ClangProjectSettings::DelayedTemplateParsing
: ClangProjectSettings::NoDelayedTemplateParsing};
QStringList options = m_projectSettings.commandLineOptions();
options.removeAll(QLatin1String{ClangProjectSettings::DelayedTemplateParsing});
options.removeAll(QLatin1String{ClangProjectSettings::NoDelayedTemplateParsing});
options.append(extraFlag);
m_projectSettings.setCommandLineOptions(options);
m_projectSettings.store();
}
void ClangProjectSettingsWidget::onClangSettingsChanged(int index)
{
m_projectSettings.setUseGlobalConfig(index == 0 ? true : false);
m_projectSettings.store();
syncOtherWidgetsToComboBox();
}
void ClangProjectSettingsWidget::syncOtherWidgetsToComboBox()
{
const QStringList options = m_projectSettings.commandLineOptions();
m_ui.delayedTemplateParse->setChecked(
options.contains(QLatin1String{ClangProjectSettings::DelayedTemplateParsing}));
const bool isCustom = !m_projectSettings.useGlobalConfig();
m_ui.generalConfigurationGroupBox->setEnabled(isCustom);
m_ui.diagnosticConfigurationGroupBox->setEnabled(isCustom);
refreshDiagnosticConfigsWidgetFromSettings();
}
void ClangProjectSettingsWidget::refreshDiagnosticConfigsWidgetFromSettings()
{
m_diagnosticConfigWidget->refresh(
createConfigsModelWithGlobalProxyConfig(*CppTools::codeModelSettings()),
configIdForProject(m_projectSettings));
CppTools::ClangDiagnosticConfigsModel configsModel(
CppTools::codeModelSettings()->clangCustomDiagnosticConfigs());
m_diagnosticConfigWidget->refresh(configsModel,
configIdForProject(m_projectSettings));
}
void ClangProjectSettingsWidget::connectToCppCodeModelSettingsChanged()
......
......@@ -49,9 +49,12 @@ public:
private:
void onCurrentWarningConfigChanged(const Core::Id &currentConfigId);
void onCustomWarningConfigsChanged(const CppTools::ClangDiagnosticConfigs &customConfigs);
void onDelayedTemplateParseClicked(bool);
void onClangSettingsChanged(int index);
void refreshDiagnosticConfigsWidgetFromSettings();
void connectToCppCodeModelSettingsChanged();
void disconnectFromCppCodeModelSettingsChanged();
void syncOtherWidgetsToComboBox();
private:
Ui::ClangProjectSettingsWidget m_ui;
......
......@@ -14,6 +14,52 @@
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QComboBox" name="clangSettings">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Global</string>
</property>
</item>
<item>
<property name="text">
<string>Custom</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QGroupBox" name="generalConfigurationGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>General</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="delayedTemplateParse">
<property name="toolTip">
<string>Parse templates in a MSVC-compliant way. This helps to parse headers for example from Active Template Library (ATL) or Windows Runtime Library (WRL).
However, using the relaxed and extended rules means also that no highlighting/completion can be provided within template functions.</string>
</property>
<property name="text">
<string>Enable MSVC-compliant template parsing</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="diagnosticConfigurationGroupBox">
<property name="title">
......
......@@ -47,14 +47,14 @@ void ClangDiagnosticConfig::setDisplayName(const QString &displayName)
m_displayName = displayName;
}
QStringList ClangDiagnosticConfig::commandLineOptions() const
QStringList ClangDiagnosticConfig::commandLineWarnings() const
{
return m_commandLineOptions;
return m_commandLineWarnings;
}
void ClangDiagnosticConfig::setCommandLineOptions(const QStringList &options)
void ClangDiagnosticConfig::setCommandLineWarnings(const QStringList &warnings)
{
m_commandLineOptions = options;
m_commandLineWarnings = warnings;
}
bool ClangDiagnosticConfig::isReadOnly() const
......@@ -71,7 +71,7 @@ bool ClangDiagnosticConfig::operator==(const ClangDiagnosticConfig &other) const
{
return m_id == other.m_id
&& m_displayName == other.m_displayName
&& m_commandLineOptions == other.m_commandLineOptions
&& m_commandLineWarnings == other.m_commandLineWarnings
&& m_isReadOnly == other.m_isReadOnly;
}
......
......@@ -43,8 +43,8 @@ public:
QString displayName() const;
void setDisplayName(const QString &displayName);
QStringList commandLineOptions() const;
void setCommandLineOptions(const QStringList &commandLineOptions);
QStringList commandLineWarnings() const;
void setCommandLineWarnings(const QStringList &commandLineWarnings);
bool isReadOnly() const;
void setIsReadOnly(bool isReadOnly);
......@@ -54,7 +54,7 @@ public:
private:
Core::Id m_id;
QString m_displayName;
QStringList m_commandLineOptions;
QStringList m_commandLineWarnings;
bool m_isReadOnly = false;
};
......
......@@ -33,7 +33,7 @@
namespace CppTools {
static QStringList commonOptions()
static QStringList commonWarnings()
{
return { QStringLiteral("-Wno-unknown-pragmas") };
}
......@@ -45,10 +45,10 @@ static void addConfigForQuestionableConstructs(ClangDiagnosticConfigsModel &mode
config.setDisplayName(QCoreApplication::translate("ClangDiagnosticConfigsModel",
"Warnings for questionable constructs"));
config.setIsReadOnly(true);
config.setCommandLineOptions(QStringList{
config.setCommandLineWarnings(QStringList{
QStringLiteral("-Wall"),
QStringLiteral("-Wextra"),
} + commonOptions());
} + commonWarnings());
model.appendOrUpdate(config);
}
......@@ -60,7 +60,7 @@ static void addConfigForPedanticWarnings(ClangDiagnosticConfigsModel &model)
config.setDisplayName(QCoreApplication::translate("ClangDiagnosticConfigsModel",
"Pedantic Warnings"));
config.setIsReadOnly(true);
config.setCommandLineOptions(QStringList{QStringLiteral("-Wpedantic")} + commonOptions());
config.setCommandLineWarnings(QStringList{QStringLiteral("-Wpedantic")} + commonWarnings());
model.appendOrUpdate(config);
}
......@@ -72,7 +72,7 @@ static void addConfigForAlmostEveryWarning(ClangDiagnosticConfigsModel &model)
config.setDisplayName(QCoreApplication::translate("ClangDiagnosticConfigsModel",
"Warnings for almost everything"));
config.setIsReadOnly(true);
config.setCommandLineOptions(QStringList{
config.setCommandLineWarnings(QStringList{
QStringLiteral("-Weverything"),
QStringLiteral("-Wno-c++98-compat"),
QStringLiteral("-Wno-c++98-compat-pedantic"),
......@@ -85,7 +85,7 @@ static void addConfigForAlmostEveryWarning(ClangDiagnosticConfigsModel &model)
QStringLiteral("-Wno-shadow"),
QStringLiteral("-Wno-missing-prototypes"), // Not optimal for C projects.
QStringLiteral("-Wno-used-but-marked-unused"), // e.g. QTest::qWait
} + commonOptions());
} + commonWarnings());
model.appendOrUpdate(config);
}
......
......@@ -115,7 +115,7 @@ void ClangDiagnosticConfigsWidget::onDiagnosticOptionsEdited()
= diagnosticOptions.trimmed().split(QLatin1Char(' '), QString::SkipEmptyParts);
ClangDiagnosticConfig updatedConfig = currentConfig();
updatedConfig.setCommandLineOptions(updatedCommandLine);
updatedConfig.setCommandLineWarnings(updatedCommandLine);
m_diagnosticConfigsModel.appendOrUpdate(updatedConfig);
emit customConfigsChanged(customConfigs());
......@@ -127,15 +127,6 @@ void ClangDiagnosticConfigsWidget::syncWidgetsToModel(const Core::Id &configToSe
syncOtherWidgetsToComboBox();
}
static QString displayNameWithBuiltinIndication(const ClangDiagnosticConfig &config,
const Core::Id &exceptionalConfig)
{
if (exceptionalConfig == config.id())
return config.displayName();
return ClangDiagnosticConfigsModel::displayNameWithBuiltinIndication(config);
}
void ClangDiagnosticConfigsWidget::syncConfigChooserToModel(const Core::Id &configToSelect)
{
disconnectConfigChooserCurrentIndex();
......@@ -148,7 +139,7 @@ void ClangDiagnosticConfigsWidget::syncConfigChooserToModel(const Core::Id &conf
for (int i = 0; i < size; ++i) {
const ClangDiagnosticConfig &config = m_diagnosticConfigsModel.at(i);
const QString displayName
= displayNameWithBuiltinIndication(config, m_configWithUndecoratedDisplayName);
= ClangDiagnosticConfigsModel::displayNameWithBuiltinIndication(config);
m_ui->configChooserComboBox->addItem(displayName, config.id().toSetting());
if (configToSelect == config.id())
......@@ -176,8 +167,8 @@ void ClangDiagnosticConfigsWidget::syncOtherWidgetsToComboBox()
m_ui->removeButton->setEnabled(!config.isReadOnly());
// Update child widgets
const QString commandLineOptions = config.commandLineOptions().join(QLatin1Char(' '));
setDiagnosticOptions(commandLineOptions);
const QString commandLineWarnings = config.commandLineWarnings().join(QLatin1Char(' '));
setDiagnosticOptions(commandLineWarnings);
m_ui->diagnosticOptionsTextEdit->setReadOnly(config.isReadOnly());
}
......@@ -228,11 +219,6 @@ void ClangDiagnosticConfigsWidget::disconnectDiagnosticOptionsChanged()
this, &ClangDiagnosticConfigsWidget::onDiagnosticOptionsEdited);
}
void ClangDiagnosticConfigsWidget::setConfigWithUndecoratedDisplayName(const Core::Id &id)
{
m_configWithUndecoratedDisplayName = id;
}
Core::Id ClangDiagnosticConfigsWidget::currentConfigId() const
{
return Core::Id::fromSetting(m_ui->configChooserComboBox->currentData());
......
......@@ -50,7 +50,6 @@ public:
Core::Id currentConfigId() const;
ClangDiagnosticConfigs customConfigs() const;
void setConfigWithUndecoratedDisplayName(const Core::Id &id);
void refresh(const ClangDiagnosticConfigsModel &diagnosticConfigsModel,
const Core::Id &configToSelect);
......@@ -82,7 +81,6 @@ private:
private:
Ui::ClangDiagnosticConfigsWidget *m_ui;
ClangDiagnosticConfigsModel m_diagnosticConfigsModel;
Core::Id m_configWithUndecoratedDisplayName;
};
} // CppTools namespace
......@@ -52,7 +52,7 @@ static QString clangDiagnosticConfigsArrayIdKey()
static QString clangDiagnosticConfigsArrayDisplayNameKey()
{ return QLatin1String("displayName"); }
static QString clangDiagnosticConfigsArrayOptionsKey()
static QString clangDiagnosticConfigsArrayWarningsKey()
{ return QLatin1String("diagnosticOptions"); }
static QString pchUsageKey()
......@@ -78,7 +78,7 @@ void CppCodeModelSettings::fromSettings(QSettings *s)
ClangDiagnosticConfig config;
config.setId(Core::Id::fromSetting(s->value(clangDiagnosticConfigsArrayIdKey())));
config.setDisplayName(s->value(clangDiagnosticConfigsArrayDisplayNameKey()).toString());
config.setCommandLineOptions(s->value(clangDiagnosticConfigsArrayOptionsKey()).toStringList());
config.setCommandLineWarnings(s->value(clangDiagnosticConfigsArrayWarningsKey()).toStringList());
m_clangCustomDiagnosticConfigs.append(config);
}
s->endArray();
......@@ -117,7 +117,7 @@ void CppCodeModelSettings::toSettings(QSettings *s)
s->setArrayIndex(i);
s->setValue(clangDiagnosticConfigsArrayIdKey(), config.id().toSetting());
s->setValue(clangDiagnosticConfigsArrayDisplayNameKey(), config.displayName());
s->setValue(clangDiagnosticConfigsArrayOptionsKey(), config.commandLineOptions());
s->setValue(clangDiagnosticConfigsArrayWarningsKey(), config.commandLineWarnings());
}
s->endArray();
......
......@@ -60,7 +60,7 @@ ProjectPart::ProjectPart(const Utf8String &projectPartId)
}
ProjectPart::ProjectPart(const Utf8String &projectPartId,
std::initializer_list<Utf8String> arguments)
const Utf8StringVector &arguments)
: d(std::make_shared<ProjectPartData>(projectPartId))
{
setArguments(arguments);
......
......@@ -42,7 +42,7 @@ class ProjectPart
{
public:
ProjectPart(const Utf8String &id = Utf8String());
ProjectPart(const Utf8String &id, std::initializer_list<Utf8String> arguments);
ProjectPart(const Utf8String &id, const Utf8StringVector &arguments);
ProjectPart(const ProjectPartContainer &projectContainer);
~ProjectPart();
......
......@@ -24,6 +24,7 @@
****************************************************************************/
#include "googletest.h"
#include "testenvironment.h"
#include <clangcodecompleteresults.h>
#include <clangdocument.h>
......@@ -148,7 +149,7 @@ protected:
bool needsReparse = false);
protected:
ClangBackEnd::ProjectPart project{Utf8StringLiteral("/path/to/projectfile")};
ClangBackEnd::ProjectPart project{Utf8StringLiteral("/path/to/projectfile"), TestEnvironment::addPlatformArguments()};
ClangBackEnd::ProjectParts projects;
ClangBackEnd::UnsavedFiles unsavedFiles;
ClangBackEnd::Documents documents{projects, unsavedFiles};
......@@ -197,7 +198,7 @@ TEST_F(CodeCompletionsExtractorSlowTest, Variable)
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractorSlowTest, DISABLED_ON_WINDOWS(NonTypeTemplateParameter))
TEST_F(CodeCompletionsExtractorSlowTest, NonTypeTemplateParameter)
{
ClangCodeCompleteResults completeResults(getResults(variableDocument, 25, 19));
......@@ -242,7 +243,7 @@ TEST_F(CodeCompletionsExtractorSlowTest, Field)
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractorSlowTest, DISABLED_ON_WINDOWS(Class))
TEST_F(CodeCompletionsExtractorSlowTest, Class)
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
......@@ -253,7 +254,7 @@ TEST_F(CodeCompletionsExtractorSlowTest, DISABLED_ON_WINDOWS(Class))
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractorSlowTest, DISABLED_ON_WINDOWS(Struct))
TEST_F(CodeCompletionsExtractorSlowTest, Struct)
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
......@@ -264,7 +265,7 @@ TEST_F(CodeCompletionsExtractorSlowTest, DISABLED_ON_WINDOWS(Struct))
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractorSlowTest, DISABLED_ON_WINDOWS(Union))
TEST_F(CodeCompletionsExtractorSlowTest, Union)
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
......@@ -275,7 +276,7 @@ TEST_F(CodeCompletionsExtractorSlowTest, DISABLED_ON_WINDOWS(Union))
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractorSlowTest, DISABLED_ON_WINDOWS(Typedef))
TEST_F(CodeCompletionsExtractorSlowTest, Typedef)
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
......@@ -286,7 +287,7 @@ TEST_F(CodeCompletionsExtractorSlowTest, DISABLED_ON_WINDOWS(Typedef))
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractorSlowTest, DISABLED_ON_WINDOWS(UsingAsTypeAlias))
TEST_F(CodeCompletionsExtractorSlowTest, UsingAsTypeAlias)
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
......@@ -297,7 +298,7 @@ TEST_F(CodeCompletionsExtractorSlowTest, DISABLED_ON_WINDOWS(UsingAsTypeAlias))
CodeCompletion::Available));
}
TEST_F(CodeCompletionsExtractorSlowTest, DISABLED_ON_WINDOWS(TemplateTypeParameter))
TEST_F(CodeCompletionsExtractorSlowTest, TemplateTypeParameter)
{
ClangCodeCompleteResults completeResults(getResults(classDocument, 20));
......@@ -308,7 +309,7 @@ TEST_F(CodeCompletionsExtractorSlowTest, DISABLED_ON_WINDOWS(TemplateTypeParamet
CodeCompletion::Available));
}