Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py

changeset 3064
2e7054d62218
parent 3062
9de9373da5bb
child 3080
6c0a430b19df
child 3091
8239cae3f947
equal deleted inserted replaced
3062:9de9373da5bb 3064:2e7054d62218
370 """ 370 """
371 Private slot to handle the "Show" button press. 371 Private slot to handle the "Show" button press.
372 """ 372 """
373 vm = e5App().getObject("ViewManager") 373 vm = e5App().getObject("ViewManager")
374 374
375 selectedIndexes = []
375 for index in range(self.resultList.topLevelItemCount()): 376 for index in range(self.resultList.topLevelItemCount()):
377 if self.resultList.topLevelItem(index).isSelected():
378 selectedIndexes.append(index)
379 if len(selectedIndexes) == 0:
380 selectedIndexes = list(range(self.resultList.topLevelItemCount()))
381 for index in selectedIndexes:
376 itm = self.resultList.topLevelItem(index) 382 itm = self.resultList.topLevelItem(index)
377 fn = Utilities.normabspath(itm.data(0, self.filenameRole)) 383 fn = Utilities.normabspath(itm.data(0, self.filenameRole))
378 vm.openSourceFile(fn, 1) 384 vm.openSourceFile(fn, 1)
385 editor = vm.getOpenEditor(fn)
386 editor.clearSyntaxError()
387 editor.clearFlakesWarnings()
388 for cindex in range(itm.childCount()):
389 citm = itm.child(cindex)
390 lineno = citm.data(0, self.lineRole)
391 index = citm.data(0, self.indexRole)
392 error = citm.data(0, self.errorRole)
393 if citm.data(0, self.warningRole):
394 editor.toggleWarning(lineno, True, error)
395 else:
396 editor.toggleSyntaxError(
397 lineno, index, True, error, show=True)
379 398
380 # go through the list again to clear syntax error and 399 # go through the list again to clear syntax error and
381 # py3flakes warning markers for files, that are ok 400 # flakes warning markers for files, that are ok
382 openFiles = vm.getOpenFilenames() 401 openFiles = vm.getOpenFilenames()
383 errorFiles = [] 402 errorFiles = []
384 for index in range(self.resultList.topLevelItemCount()): 403 for index in range(self.resultList.topLevelItemCount()):
385 itm = self.resultList.topLevelItem(index) 404 itm = self.resultList.topLevelItem(index)
386 errorFiles.append( 405 errorFiles.append(

eric ide

mercurial