# Path: lib/utils/debug.py
# def Debug(classification, text):
#     if 'all' in print_classifications or classification in print_classifications:
#         print("ArcticTypescript: %s: %s" % (classification.ljust(8), text))
#     if classification not in possible_classifications:
#         print("ArcticTypescript: debug: got unknown debug message classification: %s. " \
#             "Consider adding this to possible_classifications" % classification)
#     sys.stdout.flush()
# 
# Path: lib/utils/uiutils.py
# def get_prefix(token):
#     if token in PREFIXES:
#         return PREFIXES[token]
#     else:
#         return ''
# 
# Path: lib/utils/viewutils.py
# def get_file_infos(view):
#     return (view.file_name(), get_lines(view), get_content(view))
# 
# def get_content_of_line_at(view, pos):
#     return view.substr(sublime.Region(view.line(pos-1).a, pos))


import re
import json
import sublime
from ..utils import Debug
from ..utils.uiutils import get_prefix
from ..utils.viewutils import get_file_infos, get_content_of_line_at
            is_member_str = str( is_member ).lower() # 'true' or 'false'

            # do execute tss.js complete for cursor positon after last dot, so we use
            # sublimes fuzzy mechanism to reduce the list, not the mechanism
            # (1:1 matching of the typed chars) tss.js would use

            autocomplete_col = 0

            if is_member:
                autocomplete_col = get_col_after_last_dot( get_content_of_line_at(view, cursor_pos) )
                self.enabled_for_col_reference = 'dot'
                Debug('autocomplete', " -> use dot as referene")
                if autocomplete_col != cursor_col:
                    Debug('autocomplete', " -> dot is on col %i, use this col instead of cursor position %i" % (autocomplete_col+1, cursor_col+1))
            else:
                Debug('autocomplete', " -> use cursor position %i for autocomplete" % (cursor_col+1))
                self.enabled_for_col_reference = 'cursor'
                autocomplete_col = cursor_col

            self.enabled_for['viewid'] = view.id()
            self.enabled_for['line'] = cursor_line
            self.enabled_for['col'] = autocomplete_col

            Debug('autocomplete', " -> push current file contents as update to tss.js")
            self.project.tsserver.update(view)

            def async_react_completions_available(tss_result_json, filename, line, col, is_member_str):
                Debug('autocomplete', "Autocompletion results available for line %i , %i" % (line+1, col+1) )

                i = self.prepare_list(tss_result_json)

# Path: lib/utils/debug.py
# def Debug(classification, text):
#     if 'all' in print_classifications or classification in print_classifications:
#         print("ArcticTypescript: %s: %s" % (classification.ljust(8), text))
#     if classification not in possible_classifications:
#         print("ArcticTypescript: debug: got unknown debug message classification: %s. " \
#             "Consider adding this to possible_classifications" % classification)
#     sys.stdout.flush()
# 
# Path: lib/utils/uiutils.py
# def get_prefix(token):
#     if token in PREFIXES:
#         return PREFIXES[token]
#     else:
#         return ''
# 
# Path: lib/utils/viewutils.py
# def get_file_infos(view):
#     return (view.file_name(), get_lines(view), get_content(view))
# 
# def get_content_of_line_at(view, pos):
#     return view.substr(sublime.Region(view.line(pos-1).a, pos))


# Path: lib/system/Completion.py
import re
import json
import sublime
from ..utils import Debug
from ..utils.uiutils import get_prefix
from ..utils.viewutils import get_file_infos, get_content_of_line_at

            is_member_str = str( is_member ).lower() # 'true' or 'false'

            # do execute tss.js complete for cursor positon after last dot, so we use
            # sublimes fuzzy mechanism to reduce the list, not the mechanism
            # (1:1 matching of the typed chars) tss.js would use

            autocomplete_col = 0

            if is_member:
                autocomplete_col = get_col_after_last_dot( get_content_of_line_at(view, cursor_pos) )
                self.enabled_for_col_reference = 'dot'
                Debug('autocomplete', " -> use dot as referene")
                if autocomplete_col != cursor_col:
                    Debug('autocomplete', " -> dot is on col %i, use this col instead of cursor position %i" % (autocomplete_col+1, cursor_col+1))
            else:
                Debug('autocomplete', " -> use cursor position %i for autocomplete" % (cursor_col+1))
                self.enabled_for_col_reference = 'cursor'
                autocomplete_col = cursor_col

            self.enabled_for['viewid'] = view.id()
            self.enabled_for['line'] = cursor_line
            self.enabled_for['col'] = autocomplete_col

            Debug('autocomplete', " -> push current file contents as update to tss.js")
            self.project.tsserver.update(view)

            def async_react_completions_available(tss_result_json, filename, line, col, is_member_str):
                Debug('autocomplete', "Autocompletion results available for line %i , %i" % (line+1, col+1) )

                i = self.prepare_list(tss_result_json)

                Debug('autocomplete', " -> prepare List (%i items)" % i )