# 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
        return False
    return line_text.endswith(".") or partial_completion()


def get_col_after_last_dot(line_text):
    return line_text.rfind(".") + 1


class Completion(object):

    completion_chars = ['.']#['.',':']
    completion_list = []
    interface = False
    enabled_for_col_reference = ''     # 'dot' or 'cursor'
    enabled_for = {'line': 0, 'col': 0, 'viewid': -1}

    def __init__(self, project):
        self.project = project

    # PREPARE LISTE
    def prepare_list(self, tss_result_json):
        del self.completion_list[:]

        try:
            entries = json.loads(tss_result_json)
            entries = entries['entries']
        except:
            if tss_result_json.strip() == 'null':
                sublime.status_message('ArcticTypescript: no completions available')
            else:

# 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

        return False
    return line_text.endswith(".") or partial_completion()


def get_col_after_last_dot(line_text):
    return line_text.rfind(".") + 1


class Completion(object):

    completion_chars = ['.']#['.',':']
    completion_list = []
    interface = False
    enabled_for_col_reference = ''     # 'dot' or 'cursor'
    enabled_for = {'line': 0, 'col': 0, 'viewid': -1}

    def __init__(self, project):
        self.project = project

    # PREPARE LISTE
    def prepare_list(self, tss_result_json):
        del self.completion_list[:]

        try:
            entries = json.loads(tss_result_json)
            entries = entries['entries']
        except:
            if tss_result_json.strip() == 'null':
                sublime.status_message('ArcticTypescript: no completions available')
            else:

                Debug('error', 'Completion request failed: %s' % tss_result_json)