Skip to content
Permalink
Browse files

Expression callTips are lowercase

Expressions are case insensitive but in all the apis and samples lower case is used. Be conform.
  • Loading branch information
m-kuhn committed Sep 9, 2018
1 parent 4b9cc9b commit da7cc966963d9f9325921e90272663f2d8755df2
Showing with 25 additions and 1 deletion.
  1. +17 −1 src/gui/qgscodeeditorexpression.cpp
  2. +8 −0 src/gui/qgscodeeditorexpression.h
@@ -118,7 +118,7 @@ void QgsCodeEditorExpression::initializeLexer()

void QgsCodeEditorExpression::updateApis()
{
mApis = new QsciAPIs( mSqlLexer );
mApis = new QgsSciApisExpression( mSqlLexer );

for ( const QString &var : qgis::as_const( mVariables ) )
{
@@ -164,4 +164,20 @@ const char *QgsLexerExpression::wordCharacters() const
{
return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_@";
}

QgsSciApisExpression::QgsSciApisExpression( QsciLexer *lexer )
: QsciAPIs( lexer )
{

}

QStringList QgsSciApisExpression::callTips( const QStringList &context, int commas, QsciScintilla::CallTipsStyle style, QList<int> &shifts )
{
const QStringList originalTips = QsciAPIs::callTips( context, commas, style, shifts );
QStringList lowercaseTips;
for ( const QString &tip : originalTips )
lowercaseTips << tip.toLower();

return lowercaseTips;
}
///@endcond
@@ -91,6 +91,14 @@ class QgsLexerExpression : public QsciLexerSQL

const char *wordCharacters() const override;
};

class QgsSciApisExpression : public QsciAPIs
{
public:
QgsSciApisExpression( QsciLexer *lexer );

QStringList callTips( const QStringList &context, int commas, QsciScintilla::CallTipsStyle style, QList<int> &shifts ) override;
};
///@endcond
#endif

0 comments on commit da7cc96

Please sign in to comment.
You can’t perform that action at this time.