Commit 779fafcb authored by Christian Kamm's avatar Christian Kamm

Make C++ code style configurable.

Change-Id: Iaf08edb2361146e6b5e1cbafdb716a23c938875b
Done-with: Jarek Kobus
Task-number: QTCREATORBUG-2670
Task-number: QTCREATORBUG-4310
Task-number: QTCREATORBUG-2763
Task-number: QTCREATORBUG-3623
Task-number: QTCREATORBUG-567
Reviewed-on: http://codereview.qt.nokia.com/74Reviewed-by: default avatarLeandro T. C. Melo <leandro.melo@nokia.com>
Reviewed-by: default avatarJarek Kobus <jaroslaw.kobus@nokia.com>
Reviewed-by: default avatarRoberto Raggi <roberto.raggi@nokia.com>
parent f69eb529
......@@ -41,7 +41,8 @@
using namespace QmlJS;
CodeFormatter::BlockData::BlockData()
: m_blockRevision(-1)
: m_indentDepth(0)
, m_blockRevision(-1)
{
}
......
......@@ -36,7 +36,6 @@
#include "cpphighlighter.h"
#include "cppchecksymbols.h"
#include "cpplocalsymbols.h"
#include "cppqtstyleindenter.h"
#include "cppautocompleter.h"
#include "cppquickfixassistant.h"
......@@ -66,6 +65,8 @@
#include <cpptools/cpptoolsconstants.h>
#include <cpptools/cppcodeformatter.h>
#include <cpptools/cppcompletionassist.h>
#include <cpptools/cppqtstyleindenter.h>
#include <cpptools/cppcodestylesettings.h>
#include <coreplugin/icore.h>
#include <coreplugin/actionmanager/actionmanager.h>
......@@ -423,7 +424,7 @@ CPPEditorWidget::CPPEditorWidget(QWidget *parent)
setParenthesesMatchingEnabled(true);
setMarksVisible(true);
setCodeFoldingSupported(true);
setIndenter(new CppQtStyleIndenter);
setIndenter(new CppTools::CppQtStyleIndenter);
setAutoCompleter(new CppAutoCompleter);
baseTextDocument()->setSyntaxHighlighter(new CppHighlighter);
......@@ -1814,6 +1815,12 @@ void CPPEditorWidget::unCommentSelection()
Utils::unCommentSelection(this);
}
void CPPEditorWidget::slotCodeStyleSettingsChanged(const QVariant &)
{
CppTools::QtStyleCodeFormatter formatter;
formatter.invalidateCache(document());
}
CPPEditorWidget::Link CPPEditorWidget::linkToSymbol(CPlusPlus::Symbol *symbol)
{
if (!symbol)
......
......@@ -61,6 +61,7 @@ class Symbol;
namespace CppTools {
class CppModelManagerInterface;
class CppCodeStyleSettings;
}
namespace TextEditor {
......@@ -216,6 +217,8 @@ protected:
const CPlusPlus::Macro *findCanonicalMacro(const QTextCursor &cursor,
CPlusPlus::Document::Ptr doc) const;
protected Q_SLOTS:
void slotCodeStyleSettingsChanged(const QVariant &);
private Q_SLOTS:
void updateFileName();
......
......@@ -21,7 +21,6 @@ HEADERS += cppplugin.h \
cpplocalsymbols.h \
cpptypehierarchy.h \
cppelementevaluator.h \
cppqtstyleindenter.h \
cppautocompleter.h \
cppcompleteswitch.h \
cppsnippetprovider.h \
......@@ -43,7 +42,6 @@ SOURCES += cppplugin.cpp \
cpplocalsymbols.cpp \
cpptypehierarchy.cpp \
cppelementevaluator.cpp \
cppqtstyleindenter.cpp \
cppautocompleter.cpp \
cppcompleteswitch.cpp \
cppsnippetprovider.cpp \
......
......@@ -54,6 +54,7 @@
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/navigationwidget.h>
#include <texteditor/fontsettings.h>
#include <texteditor/tabpreferences.h>
#include <texteditor/storagesettings.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorplugin.h>
......@@ -61,6 +62,7 @@
#include <texteditor/texteditorconstants.h>
#include <cplusplus/ModelManagerInterface.h>
#include <cpptools/cpptoolsconstants.h>
#include <cpptools/cpptoolssettings.h>
#include <QtCore/QFileInfo>
#include <QtCore/QSettings>
......@@ -170,6 +172,7 @@ void CppPlugin::initializeEditor(CPPEditorWidget *editor)
{
m_actionHandler->setupActions(editor);
editor->setLanguageSettingsId(CppTools::Constants::CPP_SETTINGS_ID);
TextEditor::TextEditorSettings::instance()->initializeEditor(editor);
// method combo box sorting
......
......@@ -33,10 +33,11 @@
#include "cppsnippetprovider.h"
#include "cpphighlighter.h"
#include "cppeditor.h"
#include "cppqtstyleindenter.h"
#include "cppautocompleter.h"
#include "cppeditorconstants.h"
#include <cpptools/cppqtstyleindenter.h>
#include <texteditor/texteditorsettings.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditorconstants.h>
......@@ -73,6 +74,6 @@ void CppSnippetProvider::decorateEditor(TextEditor::SnippetEditorWidget *editor)
fs.toTextCharFormats(CPPEditorWidget::highlighterFormatCategories());
highlighter->setFormats(formats.constBegin(), formats.constEnd());
editor->setSyntaxHighlighter(highlighter);
editor->setIndenter(new CppQtStyleIndenter);
editor->setIndenter(new CppTools::CppQtStyleIndenter);
editor->setAutoCompleter(new CppAutoCompleter);
}
This diff is collapsed.
......@@ -35,8 +35,10 @@
#include "cpptools_global.h"
#include <cplusplus/SimpleLexer.h>
#include <Token.h>
#include <cplusplus/SimpleLexer.h>
#include <texteditor/tabsettings.h>
#include <cpptools/cppcodestylesettings.h>
#include <QtCore/QChar>
#include <QtCore/QStack>
......@@ -49,10 +51,6 @@ class QTextDocument;
class QTextBlock;
QT_END_NAMESPACE
namespace TextEditor {
class TabSettings;
}
namespace CppTools {
namespace Internal {
class CppCodeFormatterData;
......@@ -176,7 +174,7 @@ public: // must be public to make Q_GADGET introspection work
assign_open, // after an assignment token
expression, // after a '=' in a declaration_start once we're sure it's not '= {'
initializer // after a '=' in a declaration start
assign_open_or_initializer // after a '=' in a declaration start
};
Q_ENUMS(StateType)
......@@ -261,14 +259,11 @@ class CPPTOOLS_EXPORT QtStyleCodeFormatter : public CodeFormatter
{
public:
QtStyleCodeFormatter();
explicit QtStyleCodeFormatter(const TextEditor::TabSettings &tabSettings);
void setIndentSize(int size);
QtStyleCodeFormatter(const TextEditor::TabSettings &tabSettings,
const CppCodeStyleSettings &settings);
void setIndentSubstatementBraces(bool onOff);
void setIndentSubstatementStatements(bool onOff);
void setIndentDeclarationBraces(bool onOff);
void setIndentDeclarationMembers(bool onOff);
void setTabSettings(const TextEditor::TabSettings &tabSettings);
void setCodeStyleSettings(const CppCodeStyleSettings &settings);
protected:
virtual void onEnter(int newState, int *indentDepth, int *savedIndentDepth, int *paddingDepth, int *savedPaddingDepth) const;
......@@ -283,11 +278,8 @@ protected:
static bool shouldClearPaddingOnEnter(int state);
private:
int m_indentSize;
bool m_indentSubstatementBraces;
bool m_indentSubstatementStatements;
bool m_indentDeclarationBraces;
bool m_indentDeclarationMembers;
TextEditor::TabSettings m_tabSettings;
CppCodeStyleSettings m_styleSettings;
};
} // namespace CppTools
......
#include "cppcodestylepreferences.h"
using namespace CppTools;
static const char *settingsSuffixKey = "CodeStyleSettings";
static const char *currentFallbackKey = "CurrentFallback";
CppCodeStylePreferences::CppCodeStylePreferences(const QList<TextEditor::IFallbackPreferences *> &fallbacks, QObject *parent) :
IFallbackPreferences(fallbacks, parent)
{
connect(this, SIGNAL(currentValueChanged(QVariant)),
this, SLOT(slotCurrentValueChanged(QVariant)));
}
QVariant CppCodeStylePreferences::value() const
{
QVariant v;
v.setValue(settings());
return v;
}
void CppCodeStylePreferences::setValue(const QVariant &data)
{
if (!data.canConvert<CppCodeStyleSettings>())
return;
setSettings(data.value<CppCodeStyleSettings>());
}
CppCodeStyleSettings CppCodeStylePreferences::settings() const
{
return m_data;
}
void CppCodeStylePreferences::setSettings(const CppCodeStyleSettings &data)
{
if (m_data == data)
return;
m_data = data;
QVariant v;
v.setValue(data);
emit valueChanged(v);
emit settingsChanged(m_data);
if (!currentFallback()) {
emit currentValueChanged(v);
}
}
CppCodeStyleSettings CppCodeStylePreferences::currentSettings() const
{
QVariant v = currentValue();
if (!v.canConvert<CppCodeStyleSettings>()) {
// warning
return CppCodeStyleSettings();
}
return v.value<CppCodeStyleSettings>();
}
void CppCodeStylePreferences::slotCurrentValueChanged(const QVariant &value)
{
if (!value.canConvert<CppCodeStyleSettings>())
return;
emit currentSettingsChanged(value.value<CppCodeStyleSettings>());
}
QString CppCodeStylePreferences::settingsSuffix() const
{
return settingsSuffixKey;
}
void CppCodeStylePreferences::toMap(const QString &prefix, QVariantMap *map) const
{
m_data.toMap(prefix, map);
map->insert(prefix + QLatin1String(currentFallbackKey), currentFallbackId());
}
void CppCodeStylePreferences::fromMap(const QString &prefix, const QVariantMap &map)
{
m_data.fromMap(prefix, map);
setCurrentFallback(map.value(prefix + QLatin1String(currentFallbackKey), QLatin1String("Global")).toString());
}
#ifndef CPPCODESTYLEPREFERENCES_H
#define CPPCODESTYLEPREFERENCES_H
#include "cpptools_global.h"
#include "cppcodestylesettings.h"
#include <texteditor/ifallbackpreferences.h>
namespace CppTools {
class CPPTOOLS_EXPORT CppCodeStylePreferences : public TextEditor::IFallbackPreferences
{
Q_OBJECT
public:
explicit CppCodeStylePreferences(
const QList<TextEditor::IFallbackPreferences *> &fallbacks,
QObject *parent = 0);
virtual QVariant value() const;
virtual void setValue(const QVariant &);
CppCodeStyleSettings settings() const;
// tracks parent hierarchy until currentParentSettings is null
CppCodeStyleSettings currentSettings() const;
virtual void toMap(const QString &prefix, QVariantMap *map) const;
virtual void fromMap(const QString &prefix, const QVariantMap &map);
public slots:
void setSettings(const CppTools::CppCodeStyleSettings &data);
signals:
void settingsChanged(const CppTools::CppCodeStyleSettings &);
void currentSettingsChanged(const CppTools::CppCodeStyleSettings &);
protected:
virtual QString settingsSuffix() const;
private slots:
void slotCurrentValueChanged(const QVariant &);
private:
CppCodeStyleSettings m_data;
};
} // namespace CppTools
#endif // CPPCODESTYLEPREFERENCES_H
#include "cppcodestylesettings.h"
#include <utils/settingsutils.h>
static const char *groupPostfix = "IndentSettings";
static const char *indentBlockBracesKey = "IndentBlockBraces";
static const char *indentBlockBodyKey = "IndentBlockBody";
static const char *indentClassBracesKey = "IndentClassBraces";
static const char *indentEnumBracesKey = "IndentEnumBraces";
static const char *indentNamespaceBracesKey = "IndentNamespaceBraces";
static const char *indentNamespaceBodyKey = "IndentNamespaceBody";
static const char *indentAccessSpecifiersKey = "IndentAccessSpecifiers";
static const char *indentDeclarationsRelativeToAccessSpecifiersKey = "IndentDeclarationsRelativeToAccessSpecifiers";
static const char *indentFunctionBodyKey = "IndentFunctionBody";
static const char *indentFunctionBracesKey = "IndentFunctionBraces";
static const char *indentSwitchLabelsKey = "IndentSwitchLabels";
static const char *indentStatementsRelativeToSwitchLabelsKey = "IndentStatementsRelativeToSwitchLabels";
static const char *indentBlocksRelativeToSwitchLabelsKey = "IndentBlocksRelativeToSwitchLabels";
static const char *indentControlFlowRelativeToSwitchLabelsKey = "IndentControlFlowRelativeToSwitchLabels";
static const char *extraPaddingForConditionsIfConfusingAlignKey = "ExtraPaddingForConditionsIfConfusingAlign";
static const char *alignAssignmentsKey = "AlignAssignments";
using namespace CppTools;
// ------------------ CppCodeStyleSettingsWidget
CppCodeStyleSettings::CppCodeStyleSettings() :
indentBlockBraces(false)
, indentBlockBody(true)
, indentClassBraces(false)
, indentEnumBraces(false)
, indentNamespaceBraces(false)
, indentNamespaceBody(false)
, indentAccessSpecifiers(false)
, indentDeclarationsRelativeToAccessSpecifiers(true)
, indentFunctionBody(true)
, indentFunctionBraces(false)
, indentSwitchLabels(false)
, indentStatementsRelativeToSwitchLabels(true)
, indentBlocksRelativeToSwitchLabels(false)
, indentControlFlowRelativeToSwitchLabels(true)
, extraPaddingForConditionsIfConfusingAlign(true)
, alignAssignments(false)
{
}
void CppCodeStyleSettings::toSettings(const QString &category, QSettings *s) const
{
Utils::toSettings(QLatin1String(groupPostfix), category, s, this);
}
void CppCodeStyleSettings::fromSettings(const QString &category, const QSettings *s)
{
*this = CppCodeStyleSettings(); // Assign defaults
Utils::fromSettings(QLatin1String(groupPostfix), category, s, this);
}
void CppCodeStyleSettings::toMap(const QString &prefix, QVariantMap *map) const
{
map->insert(prefix + QLatin1String(indentBlockBracesKey), indentBlockBraces);
map->insert(prefix + QLatin1String(indentBlockBodyKey), indentBlockBody);
map->insert(prefix + QLatin1String(indentClassBracesKey), indentClassBraces);
map->insert(prefix + QLatin1String(indentEnumBracesKey), indentEnumBraces);
map->insert(prefix + QLatin1String(indentNamespaceBracesKey), indentNamespaceBraces);
map->insert(prefix + QLatin1String(indentNamespaceBodyKey), indentNamespaceBody);
map->insert(prefix + QLatin1String(indentAccessSpecifiersKey), indentAccessSpecifiers);
map->insert(prefix + QLatin1String(indentDeclarationsRelativeToAccessSpecifiersKey), indentDeclarationsRelativeToAccessSpecifiers);
map->insert(prefix + QLatin1String(indentFunctionBodyKey), indentFunctionBody);
map->insert(prefix + QLatin1String(indentFunctionBracesKey), indentFunctionBraces);
map->insert(prefix + QLatin1String(indentSwitchLabelsKey), indentSwitchLabels);
map->insert(prefix + QLatin1String(indentStatementsRelativeToSwitchLabelsKey), indentStatementsRelativeToSwitchLabels);
map->insert(prefix + QLatin1String(indentBlocksRelativeToSwitchLabelsKey), indentBlocksRelativeToSwitchLabels);
map->insert(prefix + QLatin1String(indentControlFlowRelativeToSwitchLabelsKey), indentControlFlowRelativeToSwitchLabels);
map->insert(prefix + QLatin1String(extraPaddingForConditionsIfConfusingAlignKey), extraPaddingForConditionsIfConfusingAlign);
map->insert(prefix + QLatin1String(alignAssignmentsKey), alignAssignments);
}
void CppCodeStyleSettings::fromMap(const QString &prefix, const QVariantMap &map)
{
indentBlockBraces = map.value(prefix + QLatin1String(indentBlockBracesKey),
indentBlockBraces).toBool();
indentBlockBody = map.value(prefix + QLatin1String(indentBlockBodyKey),
indentBlockBody).toBool();
indentClassBraces = map.value(prefix + QLatin1String(indentClassBracesKey),
indentClassBraces).toBool();
indentEnumBraces = map.value(prefix + QLatin1String(indentEnumBracesKey),
indentEnumBraces).toBool();
indentNamespaceBraces = map.value(prefix + QLatin1String(indentNamespaceBracesKey),
indentNamespaceBraces).toBool();
indentNamespaceBody = map.value(prefix + QLatin1String(indentNamespaceBodyKey),
indentNamespaceBody).toBool();
indentAccessSpecifiers = map.value(prefix + QLatin1String(indentAccessSpecifiersKey),
indentAccessSpecifiers).toBool();
indentDeclarationsRelativeToAccessSpecifiers = map.value(prefix + QLatin1String(indentDeclarationsRelativeToAccessSpecifiersKey),
indentDeclarationsRelativeToAccessSpecifiers).toBool();
indentFunctionBody = map.value(prefix + QLatin1String(indentFunctionBodyKey),
indentFunctionBody).toBool();
indentFunctionBraces = map.value(prefix + QLatin1String(indentFunctionBracesKey),
indentFunctionBraces).toBool();
indentSwitchLabels = map.value(prefix + QLatin1String(indentSwitchLabelsKey),
indentSwitchLabels).toBool();
indentStatementsRelativeToSwitchLabels = map.value(prefix + QLatin1String(indentStatementsRelativeToSwitchLabelsKey),
indentStatementsRelativeToSwitchLabels).toBool();
indentBlocksRelativeToSwitchLabels = map.value(prefix + QLatin1String(indentBlocksRelativeToSwitchLabelsKey),
indentBlocksRelativeToSwitchLabels).toBool();
indentControlFlowRelativeToSwitchLabels = map.value(prefix + QLatin1String(indentControlFlowRelativeToSwitchLabelsKey),
indentControlFlowRelativeToSwitchLabels).toBool();
extraPaddingForConditionsIfConfusingAlign = map.value(prefix + QLatin1String(extraPaddingForConditionsIfConfusingAlignKey),
extraPaddingForConditionsIfConfusingAlign).toBool();
alignAssignments = map.value(prefix + QLatin1String(alignAssignmentsKey),
alignAssignments).toBool();
}
bool CppCodeStyleSettings::equals(const CppCodeStyleSettings &rhs) const
{
return indentBlockBraces == rhs.indentBlockBraces
&& indentBlockBody == rhs.indentBlockBody
&& indentClassBraces == rhs.indentClassBraces
&& indentEnumBraces == rhs.indentEnumBraces
&& indentNamespaceBraces == rhs.indentNamespaceBraces
&& indentNamespaceBody == rhs.indentNamespaceBody
&& indentAccessSpecifiers == rhs.indentAccessSpecifiers
&& indentDeclarationsRelativeToAccessSpecifiers == rhs.indentDeclarationsRelativeToAccessSpecifiers
&& indentFunctionBody == rhs.indentFunctionBody
&& indentFunctionBraces == rhs.indentFunctionBraces
&& indentSwitchLabels == rhs.indentSwitchLabels
&& indentStatementsRelativeToSwitchLabels == rhs.indentStatementsRelativeToSwitchLabels
&& indentBlocksRelativeToSwitchLabels == rhs.indentBlocksRelativeToSwitchLabels
&& indentControlFlowRelativeToSwitchLabels == rhs.indentControlFlowRelativeToSwitchLabels
&& extraPaddingForConditionsIfConfusingAlign == rhs.extraPaddingForConditionsIfConfusingAlign
&& alignAssignments == rhs.alignAssignments;
}
#ifndef CPPCODESTYLESETTINGS_H
#define CPPCODESTYLESETTINGS_H
#include "cpptools_global.h"
#include <QtCore/QMetaType>
#include <QtCore/QVariant>
QT_BEGIN_NAMESPACE
class QSettings;
QT_END_NAMESPACE
namespace CppTools {
struct CPPTOOLS_EXPORT CppCodeStyleSettings
{
CppCodeStyleSettings();
bool indentBlockBraces;
bool indentBlockBody;
bool indentClassBraces;
bool indentEnumBraces;
bool indentNamespaceBraces;
bool indentNamespaceBody;
bool indentAccessSpecifiers;
bool indentDeclarationsRelativeToAccessSpecifiers;
bool indentFunctionBody;
bool indentFunctionBraces;
bool indentSwitchLabels;
bool indentStatementsRelativeToSwitchLabels;
bool indentBlocksRelativeToSwitchLabels;
bool indentControlFlowRelativeToSwitchLabels;
// false: if (a &&
// b)
// c;
// true: if (a &&
// b)
// c;
// but always: while (a &&
// b)
// foo;
bool extraPaddingForConditionsIfConfusingAlign;
// false: a = a +
// b;
// true: a = a +
// b
bool alignAssignments;
void toSettings(const QString &category, QSettings *s) const;
void fromSettings(const QString &category, const QSettings *s);
void toMap(const QString &prefix, QVariantMap *map) const;
void fromMap(const QString &prefix, const QVariantMap &map);
bool equals(const CppCodeStyleSettings &rhs) const;
};
inline bool operator==(const CppCodeStyleSettings &s1, const CppCodeStyleSettings &s2) { return s1.equals(s2); }
inline bool operator!=(const CppCodeStyleSettings &s1, const CppCodeStyleSettings &s2) { return !s1.equals(s2); }
} // namespace CppTools
Q_DECLARE_METATYPE(CppTools::CppCodeStyleSettings)
#endif // CPPCODESTYLESETTINGS_H
#include "cppcodestylesettingsfactory.h"
#include "cppcodestylesettings.h"
#include "cppcodestylesettingspage.h"
#include "cppcodestylepreferences.h"
#include "cpptoolsconstants.h"
#include <texteditor/tabpreferences.h>
#include <texteditor/tabsettings.h>
#include <QtGui/QLayout>
using namespace CppTools;
CppCodeStylePreferencesFactory::CppCodeStylePreferencesFactory()
{
}
QString CppCodeStylePreferencesFactory::languageId()
{
return Constants::CPP_SETTINGS_ID;
}
QString CppCodeStylePreferencesFactory::displayName()
{
return Constants::CPP_SETTINGS_NAME;
}
TextEditor::IFallbackPreferences *CppCodeStylePreferencesFactory::createPreferences(
const QList<TextEditor::IFallbackPreferences *> &fallbacks) const
{
return new CppCodeStylePreferences(fallbacks);
}
QWidget *CppCodeStylePreferencesFactory::createEditor(TextEditor::IFallbackPreferences *preferences,
TextEditor::TabPreferences *tabPreferences,
QWidget *parent) const
{
CppCodeStylePreferences *cppPreferences = qobject_cast<CppCodeStylePreferences *>(preferences);
if (!cppPreferences)
return 0;
Internal::CppCodeStylePreferencesWidget *widget = new Internal::CppCodeStylePreferencesWidget(parent);
widget->layout()->setMargin(0);
widget->setCppCodeStylePreferences(cppPreferences);
widget->setTabPreferences(tabPreferences);
return widget;
}
#ifndef CPPCODESTYLESETTINGSFACTORY_H
#define CPPCODESTYLESETTINGSFACTORY_H
#include <texteditor/icodestylepreferencesfactory.h>
namespace CppTools {
class CppCodeStylePreferencesFactory : public TextEditor::ICodeStylePreferencesFactory
{
public:
CppCodeStylePreferencesFactory();
virtual QString languageId();
virtual QString displayName();
virtual TextEditor::IFallbackPreferences *createPreferences(const QList<TextEditor::IFallbackPreferences *> &fallbacks) const;
virtual QWidget *createEditor(TextEditor::IFallbackPreferences *settings,
TextEditor::TabPreferences *tabSettings,
QWidget *parent) const;
};
} // namespace CppTools
#endif // CPPCODESTYLESETTINGSFACTORY_H
This diff is collapsed.
#ifndef CPPCODESTYLESETTINGSPAGE_H
#define CPPCODESTYLESETTINGSPAGE_H
#include "cpptools_global.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <QtGui/QWidget>
#include <QtCore/QPointer>
#include <QtCore/QSharedPointer>
#include <QtCore/QVariant>
#include <QtCore/QStringList>
#include "cppcodestylesettings.h"
#include "cppcodeformatter.h"
QT_BEGIN_NAMESPACE
namespace Ui {
class CppCodeStyleSettingsPage;
}
QT_END_NAMESPACE
namespace TextEditor {
class FontSettings;
class TabSettings;
class TabPreferences;
class IFallbackPreferences;
class SnippetEditorWidget;
}
namespace CppTools {