summaryrefslogtreecommitdiffstats
path: root/Plugins/SqlEnterpriseFormatter/formatstatement.h
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/SqlEnterpriseFormatter/formatstatement.h')
-rw-r--r--Plugins/SqlEnterpriseFormatter/formatstatement.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/Plugins/SqlEnterpriseFormatter/formatstatement.h b/Plugins/SqlEnterpriseFormatter/formatstatement.h
index 171b2a2..d7a432f 100644
--- a/Plugins/SqlEnterpriseFormatter/formatstatement.h
+++ b/Plugins/SqlEnterpriseFormatter/formatstatement.h
@@ -23,6 +23,7 @@ class FormatStatement
KEYWORD,
LINED_UP_KEYWORD,
ID,
+ ID_NO_WRAP,
STRING_OR_ID,
OPERATOR,
STAR,
@@ -91,6 +92,7 @@ class FormatStatement
FormatStatement& withKeyword(const QString& kw);
FormatStatement& withLinedUpKeyword(const QString& kw, const QString& lineUpName = QString());
FormatStatement& withId(const QString& id);
+ FormatStatement& withId(const QString& id, bool wrapIfNeeded);
FormatStatement& withIdList(const QStringList& names, const QString& indentName = QString(), ListSeparator sep = ListSeparator::COMMA);
FormatStatement& withOperator(const QString& oper, FormatToken::Flags flags = FormatToken::Flag::NO_FLAG);
FormatStatement& withStringOrId(const QString& id);
@@ -157,7 +159,7 @@ class FormatStatement
template <class T>
T* getFormatStatement(SqliteStatement* stmt)
{
- return dynamic_cast<T*>(forQuery(stmt, dialect, wrapper, cfg));
+ return dynamic_cast<T*>(forQuery(stmt, wrapper, cfg));
}
protected:
@@ -166,7 +168,6 @@ class FormatStatement
virtual void formatInternal() = 0;
virtual void resetInternal();
- Dialect dialect = Dialect::Sqlite3;
NameWrapper wrapper = NameWrapper::BRACKET;
Cfg::SqlEnterpriseFormatterConfig* cfg = nullptr;
@@ -196,10 +197,10 @@ class FormatStatement
QString getFinalLineUpName(const QString& lineUpName);
int predictCurrentIndent(FormatToken* currentMetaToken);
bool willStartWithNewLine(FormatToken* token);
- void formatId(const QString& value);
+ void formatId(const QString& value, bool wrappingRequested);
int getLineUpValue(const QString& lineUpName);
- static FormatStatement* forQuery(SqliteStatement *query, Dialect dialect, NameWrapper wrapper, Cfg::SqlEnterpriseFormatterConfig* cfg);
+ static FormatStatement* forQuery(SqliteStatement *query, NameWrapper wrapper, Cfg::SqlEnterpriseFormatterConfig* cfg);
QHash<QString,int> kwLineUpPosition;
QHash<QString,int> namedIndents;