eric6/QScintilla/Lexers/__init__.py

branch
maintenance
changeset 8142
43248bafe9b2
parent 8043
0acf98cd089a
parent 8027
ccbfefe5bc5a
child 8273
698ae46f40a4
--- a/eric6/QScintilla/Lexers/__init__.py	Mon Feb 01 10:38:43 2021 +0100
+++ b/eric6/QScintilla/Lexers/__init__.py	Tue Mar 02 17:12:08 2021 +0100
@@ -80,85 +80,123 @@
         (string, string, string)
     """
     supportedLanguages = {
-        "Bash": [QCoreApplication.translate('Lexers', "Bash"), 'dummy.sh',
-                 "lexerBash"],
-        "Batch": [QCoreApplication.translate('Lexers', "Batch"), 'dummy.bat',
-                  "lexerBatch"],
-        "C++": [QCoreApplication.translate('Lexers', "C/C++"), 'dummy.cpp',
-                "lexerCPP"],
-        "C#": [QCoreApplication.translate('Lexers', "C#"), 'dummy.cs',
-               "lexerCsharp"],
-        "CMake": [QCoreApplication.translate('Lexers', "CMake"), 'dummy.cmake',
-                  "lexerCMake"],
-        "CSS": [QCoreApplication.translate('Lexers', "CSS"), 'dummy.css',
-                "lexerCSS"],
-        "Cython": [QCoreApplication.translate('Lexers', "Cython"), 'dummy.pyx',
-                   "lexerCython"],
-        "D": [QCoreApplication.translate('Lexers', "D"), 'dummy.d',
-              "lexerD"],
-        "Diff": [QCoreApplication.translate('Lexers', "Diff"), 'dummy.diff',
-                 "lexerDiff"],
-        "Fortran": [QCoreApplication.translate('Lexers', "Fortran"),
-                    'dummy.f95', "lexerFortran"],
-        "Fortran77": [QCoreApplication.translate('Lexers', "Fortran77"),
-                      'dummy.f', "lexerFortran"],
-        "HTML": [QCoreApplication.translate('Lexers', "HTML/PHP/XML"),
-                 'dummy.html', "lexerHTML"],
-        "IDL": [QCoreApplication.translate('Lexers', "IDL"), 'dummy.idl',
-                "lexerIDL"],
-        "Java": [QCoreApplication.translate('Lexers', "Java"), 'dummy.java',
-                 "lexerJava"],
-        "JavaScript": [QCoreApplication.translate('Lexers', "JavaScript"),
-                       'dummy.js', "lexerJavaScript"],
-        "Lua": [QCoreApplication.translate('Lexers', "Lua"), 'dummy.lua',
-                "lexerLua"],
-        "Makefile": [QCoreApplication.translate('Lexers', "Makefile"),
-                     'dummy.mak', "lexerMakefile"],
-        "Matlab": [QCoreApplication.translate('Lexers', "Matlab"),
-                   'dummy.m.matlab', "lexerMatlab"],
-        "Octave": [QCoreApplication.translate('Lexers', "Octave"),
-                   'dummy.m.octave', "lexerOctave"],
-        "Pascal": [QCoreApplication.translate('Lexers', "Pascal"), 'dummy.pas',
-                   "lexerPascal"],
-        "Perl": [QCoreApplication.translate('Lexers', "Perl"), 'dummy.pl',
-                 "lexerPerl"],
-        "PostScript": [QCoreApplication.translate('Lexers', "PostScript"),
-                       'dummy.ps', "lexerPostscript"],
-        "Povray": [QCoreApplication.translate('Lexers', "Povray"), 'dummy.pov',
-                   "lexerPOV"],
-        "Properties": [QCoreApplication.translate('Lexers', "Properties"),
-                       'dummy.ini', "lexerProperties"],
-        "Protocol": [QCoreApplication.translate('Lexers',
-                                                "Protocol (protobuf)"),
-                     'dummy.proto', "protobuf"],
-        "Python3": [QCoreApplication.translate('Lexers', "Python3"),
-                    'dummy.py', "lexerPython3"],
-        "MicroPython": [QCoreApplication.translate('Lexers', "MicroPython"),
-                        'dummy.py', "micropython"],
-        "QSS": [QCoreApplication.translate('Lexers', "QSS"), 'dummy.qss',
-                "lexerCSS"],
-        "Ruby": [QCoreApplication.translate('Lexers', "Ruby"), 'dummy.rb',
-                 "lexerRuby"],
-        "SQL": [QCoreApplication.translate('Lexers', "SQL"), 'dummy.sql',
-                "lexerSQL"],
-        "TCL": [QCoreApplication.translate('Lexers', "TCL"), 'dummy.tcl',
-                "lexerTCL"],
-        "TeX": [QCoreApplication.translate('Lexers', "TeX"), 'dummy.tex',
-                "lexerTeX"],
-        "VHDL": [QCoreApplication.translate('Lexers', "VHDL"), 'dummy.vhd',
-                 "lexerVHDL"],
-        "XML": [QCoreApplication.translate('Lexers', "XML"), 'dummy.xml',
-                "lexerXML"],
-        "YAML": [QCoreApplication.translate('Lexers', "YAML"), 'dummy.yml',
-                 "lexerYAML"],
-        "Gettext": [QCoreApplication.translate('Lexers', "Gettext"),
-                    'dummy.po', "lexerGettext"],
-        "CoffeeScript": [QCoreApplication.translate('Lexers', "CoffeeScript"),
-                         'dummy.coffee', "lexerCoffeeScript"],
-        "JSON": [QCoreApplication.translate('Lexers', "JSON"), 'dummy.json',
-                 "lexerJSON"],
-        "Markdown": [QCoreApplication.translate('Lexers', "Markdown"),
-                     'dummy.md', "lexerMarkdown"],
+        "Bash":
+            [QCoreApplication.translate('Lexers', "Bash"), 'dummy.sh',
+             "lexerBash"],
+        "Batch":
+            [QCoreApplication.translate('Lexers', "Batch"), 'dummy.bat',
+             "lexerBatch"],
+        "C++":
+            [QCoreApplication.translate('Lexers', "C/C++"), 'dummy.cpp',
+             "lexerCPP"],
+        "C#":
+            [QCoreApplication.translate('Lexers', "C#"), 'dummy.cs',
+             "lexerCsharp"],
+        "CMake":
+            [QCoreApplication.translate('Lexers', "CMake"), 'dummy.cmake',
+             "lexerCMake"],
+        "CSS":
+            [QCoreApplication.translate('Lexers', "CSS"), 'dummy.css',
+             "lexerCSS"],
+        "Cython":
+            [QCoreApplication.translate('Lexers', "Cython"), 'dummy.pyx',
+             "lexerCython"],
+        "D":
+            [QCoreApplication.translate('Lexers', "D"), 'dummy.d',
+             "lexerD"],
+        "Diff":
+            [QCoreApplication.translate('Lexers', "Diff"), 'dummy.diff',
+             "lexerDiff"],
+        "Fortran":
+            [QCoreApplication.translate('Lexers', "Fortran"), 'dummy.f95',
+             "lexerFortran"],
+        "Fortran77":
+            [QCoreApplication.translate('Lexers', "Fortran77"), 'dummy.f',
+             "lexerFortran"],
+        "HTML":
+            [QCoreApplication.translate('Lexers', "HTML/PHP/XML"),
+             'dummy.html', "lexerHTML"],
+        "IDL":
+            [QCoreApplication.translate('Lexers', "IDL"), 'dummy.idl',
+             "lexerIDL"],
+        "Java":
+            [QCoreApplication.translate('Lexers', "Java"), 'dummy.java',
+             "lexerJava"],
+        "JavaScript":
+            [QCoreApplication.translate('Lexers', "JavaScript"), 'dummy.js',
+             "lexerJavaScript"],
+        "Lua":
+            [QCoreApplication.translate('Lexers', "Lua"), 'dummy.lua',
+             "lexerLua"],
+        "Makefile":
+            [QCoreApplication.translate('Lexers', "Makefile"), 'dummy.mak',
+             "lexerMakefile"],
+        "Matlab":
+            [QCoreApplication.translate('Lexers', "Matlab"), 'dummy.m.matlab',
+             "lexerMatlab"],
+        "Octave":
+            [QCoreApplication.translate('Lexers', "Octave"), 'dummy.m.octave',
+             "lexerOctave"],
+        "Pascal":
+            [QCoreApplication.translate('Lexers', "Pascal"), 'dummy.pas',
+             "lexerPascal"],
+        "Perl":
+            [QCoreApplication.translate('Lexers', "Perl"), 'dummy.pl',
+             "lexerPerl"],
+        "PostScript":
+            [QCoreApplication.translate('Lexers', "PostScript"), 'dummy.ps',
+             "lexerPostscript"],
+        "Povray":
+            [QCoreApplication.translate('Lexers', "Povray"), 'dummy.pov',
+             "lexerPOV"],
+        "Properties":
+            [QCoreApplication.translate('Lexers', "Properties"), 'dummy.ini',
+             "lexerProperties"],
+        "Protocol Buffer": [
+            QCoreApplication.translate('Lexers', "Protocol Buffer (protobuf)"),
+            'dummy.proto', "protobuf"],
+        "Python3":
+            [QCoreApplication.translate('Lexers', "Python3"), 'dummy.py',
+             "lexerPython3"],
+        "MicroPython":
+            [QCoreApplication.translate('Lexers', "MicroPython"), 'dummy.py',
+             "micropython"],
+        "QSS":
+            [QCoreApplication.translate('Lexers', "QSS"), 'dummy.qss',
+             "lexerCSS"],
+        "Ruby":
+            [QCoreApplication.translate('Lexers', "Ruby"), 'dummy.rb',
+             "lexerRuby"],
+        "SQL":
+            [QCoreApplication.translate('Lexers', "SQL"), 'dummy.sql',
+             "lexerSQL"],
+        "TCL":
+            [QCoreApplication.translate('Lexers', "TCL"), 'dummy.tcl',
+             "lexerTCL"],
+        "TeX":
+            [QCoreApplication.translate('Lexers', "TeX"), 'dummy.tex',
+             "lexerTeX"],
+        "VHDL":
+            [QCoreApplication.translate('Lexers', "VHDL"), 'dummy.vhd',
+             "lexerVHDL"],
+        "XML":
+            [QCoreApplication.translate('Lexers', "XML"), 'dummy.xml',
+             "lexerXML"],
+        "YAML":
+            [QCoreApplication.translate('Lexers', "YAML"), 'dummy.yml',
+             "lexerYAML"],
+        "Gettext":
+            [QCoreApplication.translate('Lexers', "Gettext"), 'dummy.po',
+             "lexerGettext"],
+        "CoffeeScript":
+            [QCoreApplication.translate('Lexers', "CoffeeScript"),
+             'dummy.coffee', "lexerCoffeeScript"],
+        "JSON":
+            [QCoreApplication.translate('Lexers', "JSON"), 'dummy.json',
+             "lexerJSON"],
+        "Markdown":
+            [QCoreApplication.translate('Lexers', "Markdown"), 'dummy.md',
+             "lexerMarkdown"],
     }
     
     for name in LexerRegistry:
@@ -214,7 +252,7 @@
     @param language language of the lexer (string)
     @param parent reference to the parent object (QObject)
     @param pyname name of the pygments lexer to use (string)
-    @return reference to the instanciated lexer object (QsciLexer)
+    @return reference to the instantiated lexer object (QsciLexer)
     """
     if not pyname:
         try:
@@ -329,7 +367,7 @@
                 from .LexerMarkdown import LexerMarkdown
                 return LexerMarkdown(parent)
             
-            elif language == "Protocol":
+            elif language == "Protocol Buffer":
                 return __getPygmentsLexer(parent, name="Protocol Buffer")
             
             elif language in LexerRegistry:
@@ -393,7 +431,7 @@
             'IDL Files (*.idl)'),
         QCoreApplication.translate(
             'Lexers',
-            'Protocol Files (*.proto)'),
+            'Protocol Buffer Files (*.proto)'),
         QCoreApplication.translate(
             'Lexers',
             'C Files (*.h *.c)'),
@@ -569,7 +607,7 @@
             "IDL Files (*.idl)"),
         QCoreApplication.translate(
             'Lexers',
-            'Protocol Files (*.proto)'),
+            'Protocol Buffer Files (*.proto)'),
         QCoreApplication.translate(
             'Lexers',
             "C Files (*.c)"),
@@ -842,6 +880,7 @@
         '*.m': "Matlab",
         '*.m.matlab': "Matlab",
         '*.m.octave': "Octave",
+        '*.e4c': "XML",
         '*.e4d': "XML",
         '*.e4k': "XML",
         '*.e4m': "XML",
@@ -863,7 +902,16 @@
         '*.e6q': "XML",
         '*.e6s': "XML",
         '*.e6t': "XML",
-        '*.proto': "Protocol",
+        '*.ecj': "JSON",
+        '*.edj': "JSON",
+        '*.ehj': "JSON",
+        '*.ekj': "JSON",
+        '*.emj': "JSON",
+        '*.epj': "JSON",
+        '*.eqj': "JSON",
+        '*.esj': "JSON",
+        '*.etj': "JSON",
+        '*.proto': "Protocol Buffer",
         '*.po': "Gettext",
         '*.coffee': "CoffeeScript",
         '*.json': "JSON",

eric ide

mercurial