22#include <Qsci/qscilexerjson.h>
32 , mLanguage( language )
77 QsciLexer *lexer =
nullptr;
105 lexer =
new QgsQsciLexerBash();
108 lexer =
new QgsQsciLexerBatch();
116 lexer->setDefaultFont( font );
117 lexer->setFont( font, -1 );
123 font.setItalic(
true );
124 lexer->setFont( font, QgsQsciLexerBash::LineComment );
148 font.setItalic(
true );
149 lexer->setFont( font, QgsQsciLexerBatch::Comment );
177QgsQsciLexerBash::QgsQsciLexerBash( QObject *parent )
178 : QsciLexer( parent )
183const char *QgsQsciLexerBash::language()
const
188const char *QgsQsciLexerBash::lexer()
const
193int QgsQsciLexerBash::lexerId()
const
195 return QsciScintillaBase::SCLEX_BASH;
198QString QgsQsciLexerBash::description(
int style )
const
203 return tr(
"Default" );
205 return tr(
"Error" );
207 return tr(
"Comment" );
209 return tr(
"Number" );
211 return tr(
"Keyword" );
213 return tr(
"String" );
214 case SingleQuotedString:
215 return tr(
"Single Quoted String" );
217 return tr(
"Operator" );
219 return tr(
"Identifier" );
221 return tr(
"Scale Variable" );
223 return tr(
"Parameter" );
224 case BacktickQuotedCommand:
225 return tr(
"Backtick Quoted Command" );
226 case HeredocDelimiter:
227 return tr(
"Heredoc Delimiter" );
228 case HeredocQuotedString:
229 return tr(
"Heredoc Quoted String" );
234const char *QgsQsciLexerBash::keywords(
int set )
const
239 return "case cat do done echo else esac exit export fi find for if in set then while";
247QgsQsciLexerBatch::QgsQsciLexerBatch( QObject *parent )
248 : QsciLexer( parent )
253const char *QgsQsciLexerBatch::language()
const
258const char *QgsQsciLexerBatch::lexer()
const
263int QgsQsciLexerBatch::lexerId()
const
265 return QsciScintillaBase::SCLEX_BATCH;
268QString QgsQsciLexerBatch::description(
int style )
const
273 return tr(
"Default" );
275 return tr(
"Comment" );
279 return tr(
"Label" );
283 return tr(
"Command" );
285 return tr(
"Operator" );
287 return tr(
"Identifier" );
292const char *QgsQsciLexerBatch::keywords(
int set )
const
297 return "call defined do echo else errorlevel exist exit for goto if in not set";
ScriptLanguage
Scripting languages.
@ QgisExpression
QGIS expressions.
@ Batch
Windows batch files.
@ Unknown
Unknown/other language.
@ CommentBlock
Comment block color.
@ Decoration
Decoration color.
@ Identifier
Identifier color.
@ DoubleQuote
Double quote color.
@ CommentLine
Line comment color.
@ Default
Default text color.
@ Background
Background color.
@ SingleQuote
Single quote color.
@ Operator
Operator color.
void initializeLexer() override
Called when the dialect specific code lexer needs to be initialized (or reinitialized).
Qgis::ScriptLanguage language() const override
Returns the associated scripting language.
QgsCodeEditorShell(QWidget *parent=nullptr, QgsCodeEditor::Mode mode=QgsCodeEditor::Mode::ScriptEditor, Qgis::ScriptLanguage language=Qgis::ScriptLanguage::Unknown)
Constructor for QgsCodeEditorShell.
A text editor based on QScintilla2.
void runPostLexerConfigurationTasks()
Performs tasks which must be run after a lexer has been set for the widget.
void setTitle(const QString &title)
Set the widget title.
Flag
Flags controlling behavior of code editor.
void setLineNumbersVisible(bool visible)
Sets whether line numbers should be visible in the editor.
QFont lexerFont() const
Returns the font to use in the lexer.
QColor lexerColor(QgsCodeEditorColorScheme::ColorRole role) const
Returns the color to use in the lexer for the specified role.