Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py

branch
5_3_x
changeset 3063
2da2fa1ce1ff
parent 2302
f29e9405c851
child 3163
9f50365a0870
diff -r 216b1d41f58d -r 2da2fa1ce1ff Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py	Tue Oct 29 12:37:42 2013 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py	Wed Nov 06 19:43:32 2013 +0100
@@ -142,6 +142,8 @@
         self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
         QApplication.processEvents()
         
+        self.__clearErrors()
+        
         if isinstance(fn, list):
             files = fn
         elif os.path.isdir(fn):
@@ -365,10 +367,28 @@
         """
         vm = e5App().getObject("ViewManager")
         
+        selectedIndexes = []
         for index in range(self.resultList.topLevelItemCount()):
+            if self.resultList.topLevelItem(index).isSelected():
+                selectedIndexes.append(index)
+        if len(selectedIndexes) == 0:
+            selectedIndexes = list(range(self.resultList.topLevelItemCount()))
+        for index in selectedIndexes:
             itm = self.resultList.topLevelItem(index)
             fn = Utilities.normabspath(itm.data(0, self.filenameRole))
             vm.openSourceFile(fn, 1)
+            editor = vm.getOpenEditor(fn)
+            editor.clearSyntaxError()
+            editor.clearFlakesWarnings()
+            for cindex in range(itm.childCount()):
+                citm = itm.child(cindex)
+                lineno = citm.data(0, self.lineRole)
+                index = citm.data(0, self.indexRole)
+                error = citm.data(0, self.errorRole)
+                if citm.data(0, self.warningRole):
+                    editor.toggleFlakesWarning(lineno, True, error)
+                else:
+                    editor.toggleSyntaxError(lineno, index, True, error, show=True)
         
         # go through the list again to clear syntax error and
         # py3flakes warning markers for files, that are ok

eric ide

mercurial