eric4.QScintilla.Lexers.__init__
Package implementing lexers for the various supported programming languages.
Global Attributes
Classes
Functions
__getPygmentsLexer
__getPygmentsLexer(parent, name = "")
Private module function to instantiate a pygments lexer.
- parent
-
reference to the parent widget
- name=
-
name of the pygments lexer to use (string)
- Returns:
-
reference to the lexer (LexerPygments) or None
getDefaultLexerAssociations
getDefaultLexerAssociations()
Module function to get a dictionary with the default associations.
- Returns:
-
dictionary with the default lexer associations
getLexer
getLexer(language, parent = None, pyname = "")
Module function to instantiate a lexer object for a given language.
- language
-
language of the lexer (string)
- parent
-
reference to the parent object (QObject)
- pyname=
-
name of the pygments lexer to use (string)
- Returns:
-
reference to the instanciated lexer object (QsciLexer)
getOpenFileFiltersList
getOpenFileFiltersList(includeAll = False, asString = False, withAdditional = True)
Module function to get the file filter list for an open file operation.
- includeAll
-
flag indicating the inclusion of the
All Files filter (boolean)
- asString
-
flag indicating the list should be returned
as a string (boolean)
- withAdditional=
-
flag indicating to include additional filters
defined by the user (boolean)
- Returns:
-
file filter list (QStringList or QString)
getSaveFileFiltersList
getSaveFileFiltersList(includeAll = False, asString = False, withAdditional = True)
Module function to get the file filter list for a save file operation.
- includeAll
-
flag indicating the inclusion of the
All Files filter (boolean)
- asString
-
flag indicating the list should be returned
as a string (boolean)
- withAdditional=
-
flag indicating to include additional filters
defined by the user (boolean)
- Returns:
-
file filter list (QStringList or QString)
getSupportedLanguages
getSupportedLanguages()
Module function to get a dictionary of supported lexer languages.
- Returns:
-
dictionary of supported lexer languages. The keys are the
internal language names. The items are lists of two entries.
The first is the display string for the language, the second
is a dummy file name, which can be used to derive the lexer.
(QString, string)
registerLexer
registerLexer(name, displayString, filenameSample, getLexerFunc, openFilters = QStringList(), saveFilters = QStringList(), defaultAssocs = [])
Module function to register a custom QScintilla lexer.
- name
-
lexer language name (string)
- displayString
-
display string (QString)
- filenameSample
-
dummy filename to derive lexer name (string)
- getLexerFunc
-
reference to a function instantiating the specific lexer.
This function must take a reference to the parent as it's only argument.
- openFilters=
-
list of open file filters (QStringList)
- saveFilters=
-
list of save file filters (QStringList)
- defaultAssocs=
-
default lexer associations (list of strings of filename
wildcard patterns to be associated with the lexer)
- Raises KeyError:
-
raised when the given name is already in use
unregisterLexer
unregisterLexer(name)
Module function to unregister a custom QScintilla lexer.
- name
-
lexer language name (string)