aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/SqlEnterpriseFormatter/sqlenterpriseformatter.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-12-17 07:06:30 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-12-17 07:06:30 -0500
commit1fdc150116cad39aae5c5da407c3312b47a59e3a (patch)
tree123c79a4d7ad2d45781ba03ce939f7539fb428d8 /Plugins/SqlEnterpriseFormatter/sqlenterpriseformatter.cpp
parentfeda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff)
New upstream version 3.3.3+dfsg1.upstream/3.3.3+dfsg1
Diffstat (limited to 'Plugins/SqlEnterpriseFormatter/sqlenterpriseformatter.cpp')
-rw-r--r--Plugins/SqlEnterpriseFormatter/sqlenterpriseformatter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Plugins/SqlEnterpriseFormatter/sqlenterpriseformatter.cpp b/Plugins/SqlEnterpriseFormatter/sqlenterpriseformatter.cpp
index 8bed056..62517c6 100644
--- a/Plugins/SqlEnterpriseFormatter/sqlenterpriseformatter.cpp
+++ b/Plugins/SqlEnterpriseFormatter/sqlenterpriseformatter.cpp
@@ -27,7 +27,7 @@ QString SqlEnterpriseFormatter::format(SqliteQueryPtr query)
QString formatted = formatStmt->format();
delete formatStmt;
- QString formattedWithComments = applyComments(formatted, comments, query->dialect);
+ QString formattedWithComments = applyComments(formatted, comments);
for (Comment* c : comments)
delete c;
@@ -46,7 +46,7 @@ bool SqlEnterpriseFormatter::init()
");");
static_qstring(query4, "CREATE UNIQUE INDEX IF NOT EXISTS dbName.idx1 ON [messages column] (id COLLATE x ASC, lang DESC, description);");
- Parser parser(Dialect::Sqlite3);
+ Parser parser;
for (const QString& q : {query1, query2, query3, query4})
{
@@ -271,14 +271,14 @@ void SqlEnterpriseFormatter::wrapComment(const TokenPtr &token, bool isAtLineEnd
token->value = multiCommentTpl.arg(token->value);
}
-QString SqlEnterpriseFormatter::applyComments(const QString& formatted, QList<SqlEnterpriseFormatter::Comment*> comments, Dialect dialect)
+QString SqlEnterpriseFormatter::applyComments(const QString& formatted, QList<SqlEnterpriseFormatter::Comment*> comments)
{
if (comments.size() == 0)
return formatted;
int currentCommentPosition = comments.first()->position;
- TokenList allTokens = Lexer::tokenize(formatted, dialect);
+ TokenList allTokens = Lexer::tokenize(formatted);
TokenList newTokens;
int currentTokenPosition = 0;
for (const TokenPtr& token : allTokens)