def highlight_all_open_files(self):
""" update hightlights (red underline) in all files, using the errors in project """
self.errors = {}
# iterate through all open views, to remove all remaining outdated underlinings
for window in sublime.windows():
for view in window.views():
if is_ts(view):
error_regions, warning_regions, error_texts = \
self.project.errors.tssjs_to_highlighter(view)
self.errors[fn2k(view.file_name())] = error_texts
# apply regions, even if empty (that will remove every highlight in that file)
view.add_regions('typescript-error' , error_regions , 'invalid' , self.error_icon, self.underline)
view.add_regions('typescript-warnings' , warning_regions , 'invalid' , self.warning_icon, self.underline)
评论列表
文章目录