<s> '''<STR_LIT>''' <EOL> from collections import defaultdict <EOL> import threading <EOL> from Dart . sublime_plugin_lib . panels import OutputPanel <EOL> from Dart . lib . autocomplete import AutocompleteContext <EOL> class EditorContext ( object ) : <EOL> write_lock = threading . Lock ( ) <EOL> def __init__ ( self ) : <EOL> self . results_panel = None <EOL> self . _navigation = None <EOL> self . _errors = [ ] <EOL> self . _errors_index = - <NUM_LIT:1> <EOL> self . autocomplete_context = AutocompleteContext ( ) <EOL> @ property <EOL> def navigation ( self ) : <EOL> with EditorContext . write_lock : <EOL> return self . _navigation <EOL> @ navigation . setter <EOL> def navigation ( self , value ) : <EOL> with EditorContext . write_lock : <EOL> self . _navigation = value <EOL> @ property <EOL> def errors ( self ) : <EOL> with EditorContext . write_lock : <EOL> return self . _errors <EOL> @ errors . setter <EOL> def errors ( self , values ) : <EOL> with EditorContext . write_lock : <EOL> self . _errors_index = - <NUM_LIT:1> <EOL> self . _errors = list ( values ) <EOL> @ property <EOL> def errors_index ( self ) : <EOL> with EditorContext . write_lock : <EOL> return self . _errors_index <EOL> def increment_error_index ( self ) : <EOL> with EditorContext . write_lock : <EOL> if self . _errors_index == len ( self . _errors ) - <NUM_LIT:1> : <EOL> raise IndexError ( '<STR_LIT>' ) <EOL> self . _errors_index += <NUM_LIT:1> <EOL> def decrement_error_index ( self ) : <EOL> with EditorContext . write_lock : <EOL> if self . _errors_index == <NUM_LIT:0> : <EOL> raise IndexError ( '<STR_LIT>' ) <EOL> self . _errors_index -= <NUM_LIT:1> <EOL> def get_current_error ( self ) : <EOL> return self . errors [ self . errors_index ] </s>
