src/eric7/QScintilla/Lexers/__init__.py

branch
eric7
changeset 9612
93b496cc3c88
parent 9609
c2f9c10c47cc
child 9653
e67609152c5e
diff -r af03537d56b2 -r 93b496cc3c88 src/eric7/QScintilla/Lexers/__init__.py
--- a/src/eric7/QScintilla/Lexers/__init__.py	Sun Dec 11 18:24:41 2022 +0100
+++ b/src/eric7/QScintilla/Lexers/__init__.py	Mon Dec 12 16:35:21 2022 +0100
@@ -7,8 +7,6 @@
 Package implementing lexers for the various supported programming languages.
 """
 
-# TODO: move IDL and Protobuf stuff to the plugins
-
 import contextlib
 import importlib
 
@@ -66,6 +64,7 @@
     @exception KeyError raised when the given name is already in use
     """
     global LexerRegistry
+
     if name in LexerRegistry:
         raise KeyError('Lexer "{0}" already registered.'.format(name))
     else:
@@ -91,6 +90,8 @@
     @param name lexer language name
     @type str
     """
+    global LexerRegistry
+
     if name in LexerRegistry:
         textFilePatterns = Preferences.getUI("TextFilePatterns")
         for pat in LexerRegistry[name][5]:
@@ -153,7 +154,6 @@
             "dummy.html",
             "lexerHTML",
         ],
-        "IDL": [QCoreApplication.translate("Lexers", "IDL"), "dummy.idl", "lexerIDL"],
         "Java": [
             QCoreApplication.translate("Lexers", "Java"),
             "dummy.java",
@@ -201,11 +201,6 @@
             "dummy.ini",
             "lexerProperties",
         ],
-        "Protocol Buffer": [
-            QCoreApplication.translate("Lexers", "Protocol Buffer (protobuf)"),
-            "dummy.proto",
-            "protobuf",
-        ],
         "Python3": [
             QCoreApplication.translate("Lexers", "Python3"),
             "dummy.py",
@@ -326,7 +321,6 @@
             "Fortran77": ".LexerFortran77",
             "Gettext": ".LexerPO",
             "HTML": ".LexerHTML",
-            "IDL": ".LexerIDL",
             "Java": ".LexerJava",
             "JavaScript": ".LexerJavaScript",
             "JSON": ".LexerJSON",
@@ -361,8 +355,6 @@
                     return mod.createLexer(language, parent)
                 else:
                     return __getPygmentsLexer(parent)
-            elif language == "Protocol Buffer":
-                return __getPygmentsLexer(parent, name="Protocol Buffer")
 
             elif language in LexerRegistry:
                 return LexerRegistry[language][2](parent)
@@ -410,8 +402,6 @@
         QCoreApplication.translate("Lexers", "Cython Files (*.pyx *.pxd *.pxi)"),
         QCoreApplication.translate("Lexers", "Quixote Template Files (*.ptl)"),
         QCoreApplication.translate("Lexers", "Ruby Files (*.rb)"),
-        QCoreApplication.translate("Lexers", "IDL Files (*.idl)"),
-        QCoreApplication.translate("Lexers", "Protocol Buffer Files (*.proto)"),
         QCoreApplication.translate("Lexers", "C Files (*.h *.c)"),
         QCoreApplication.translate(
             "Lexers", "C++ Files (*.h *.hpp *.hh *.cxx *.cpp *.cc)"
@@ -505,8 +495,6 @@
         QCoreApplication.translate("Lexers", "Cython Include Files (*.pxi)"),
         QCoreApplication.translate("Lexers", "Quixote Template Files (*.ptl)"),
         QCoreApplication.translate("Lexers", "Ruby Files (*.rb)"),
-        QCoreApplication.translate("Lexers", "IDL Files (*.idl)"),
-        QCoreApplication.translate("Lexers", "Protocol Buffer Files (*.proto)"),
         QCoreApplication.translate("Lexers", "C Files (*.c)"),
         QCoreApplication.translate("Lexers", "C++ Files (*.cpp)"),
         QCoreApplication.translate("Lexers", "C++/C Header Files (*.h)"),
@@ -620,7 +608,6 @@
         "*.ts": "HTML",
         "*.qrc": "HTML",
         "*.kid": "HTML",
-        "*.idl": "IDL",
         "*.java": "Java",
         "*.js": "JavaScript",
         "*.lua": "Lua",
@@ -716,7 +703,6 @@
         "*.esj": "JSON",
         "*.etj": "JSON",
         "*.ethj": "JSON",
-        "*.proto": "Protocol Buffer",
         "*.po": "Gettext",
         "*.coffee": "CoffeeScript",
         "*.json": "JSON",

eric ide

mercurial