--- a/src/eric7/QScintilla/Editor.py Mon Nov 06 12:00:55 2023 +0100 +++ b/src/eric7/QScintilla/Editor.py Mon Nov 06 19:12:33 2023 +0100 @@ -150,6 +150,7 @@ WarningPython = 2 WarningStyle = 3 WarningInfo = 4 + WarningError = 5 # Autocompletion icon definitions ClassID = 1 @@ -6934,6 +6935,20 @@ """ self.__clearTypedWarning(Editor.WarningInfo) + @pyqtSlot() + def clearErrorWarnings(self): + """ + Public slot to clear all error warnings. + """ + self.__clearTypedWarning(Editor.WarningError) + + @pyqtSlot() + def clearCodeWarnings(self): + """ + Public slot to clear all code warnings. + """ + self.__clearTypedWarning(Editor.WarningCode) + def __clearTypedWarning(self, warningKind): """ Private method to clear warnings of a specific kind. @@ -7072,6 +7087,8 @@ for msg, warningType in self._warnings[handle]: if warningType == Editor.WarningInfo: infoAnnotations.append(self.tr("Info: {0}").format(msg)) + elif warningType == Editor.WarningError: + errorAnnotations.append(self.tr("Error: {0}").format(msg)) elif warningType == Editor.WarningStyle: styleAnnotations.append(self.tr("Style: {0}").format(msg)) elif warningType == Editor.WarningPython: @@ -7087,6 +7104,7 @@ for msg, _ in self.syntaxerrors[handle]: errorAnnotations.append(self.tr("Error: {0}").format(msg)) + # step 3: assemble the annotation annotations = [] if infoAnnotations: annotationInfoTxt = "\n".join(infoAnnotations)