Skip to content

Commit

Permalink
Restored missing completer positions (string, number, blob literal).
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelsalawa committed Dec 27, 2024
1 parent cf266fd commit 9682eb5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
3 changes: 3 additions & 0 deletions SQLiteStudio3/coreSQLiteStudio/completioncomparer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ CompletionComparer::CompletionComparer(CompletionHelper *helper)

bool CompletionComparer::operator ()(const ExpectedTokenPtr& token1, const ExpectedTokenPtr& token2)
{
if (token2->type == ExpectedToken::OTHER || token1->type == ExpectedToken::OTHER)
qDebug() << "";

if ((token1->priority > 0 || token2->priority > 0) && token1->priority != token2->priority)
return token1->priority > token2->priority;

Expand Down
8 changes: 4 additions & 4 deletions SQLiteStudio3/coreSQLiteStudio/completionhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,13 @@ QList<ExpectedTokenPtr> CompletionHelper::getExpectedTokens(TokenPtr token)
results += getExpectedToken(ExpectedToken::OTHER, QString(), QString(), tr("Any word"));
break;
case Token::STRING:
results += getExpectedToken(ExpectedToken::STRING);
results += getExpectedToken(ExpectedToken::STRING, QString(), QString(), tr("String"));
break;
case Token::FLOAT:
results += getExpectedToken(ExpectedToken::NUMBER);
results += getExpectedToken(ExpectedToken::NUMBER, QString(), QString(), tr("Number"));
break;
case Token::INTEGER:
results += getExpectedToken(ExpectedToken::NUMBER);
results += getExpectedToken(ExpectedToken::NUMBER, QString(), QString(), tr("Number"));
break;
case Token::OPERATOR:
results += getExpectedToken(ExpectedToken::OPERATOR, token->value);
Expand All @@ -275,7 +275,7 @@ QList<ExpectedTokenPtr> CompletionHelper::getExpectedTokens(TokenPtr token)
results += getExpectedToken(ExpectedToken::OPERATOR, ")");
break;
case Token::BLOB:
results += getExpectedToken(ExpectedToken::BLOB);
results += getExpectedToken(ExpectedToken::BLOB, QString(), QString(), tr("BLOB literal"));
break;
case Token::KEYWORD:
results += getExpectedToken(ExpectedToken::KEYWORD, token->value);
Expand Down
10 changes: 5 additions & 5 deletions SQLiteStudio3/coreSQLiteStudio/expectedtoken.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ struct API_EXPORT ExpectedToken
VIEW,
DATABASE,
NO_VALUE,
STRING,
NUMBER,
BLOB,
OTHER,
KEYWORD,
FUNCTION,
OPERATOR,
COLLATION,
PRAGMA,
STRING,
NUMBER,
BLOB,
OTHER
PRAGMA
};

/**
Expand Down
3 changes: 2 additions & 1 deletion SQLiteStudio3/coreSQLiteStudio/parser/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ void Parser::expectedTokenLookup(void* pParser)
Token::CTX_ALIAS, Token::CTX_TABLE_NEW, Token::CTX_INDEX_NEW, Token::CTX_TRIGGER_NEW,
Token::CTX_VIEW_NEW, Token::CTX_COLUMN_NEW, Token::CTX_TRANSACTION,
Token::CTX_CONSTRAINT, Token::CTX_COLUMN_TYPE, Token::CTX_OLD_KW, Token::CTX_NEW_KW,
Token::CTX_ROWID_KW, Token::CTX_STRICT_KW, Token::INVALID
Token::CTX_ROWID_KW, Token::CTX_STRICT_KW, Token::INVALID,
Token::BLOB, Token::STRING, Token::FLOAT, Token::INTEGER
});

for (TokenPtr token : tokenSet)
Expand Down

0 comments on commit 9682eb5

Please sign in to comment.