<NME> LanguageClientSource.py
<BEF> from .base import Base


COMPLETE_OUTPUTS = "g:LanguageClient_omniCompleteResults"


class Source(Base):
    def __init__(self, vim):
        super().__init__(vim)

        self.name = "LanguageClient"
        self.mark = "[LC]"
        self.rank = 1000
        self.min_pattern_length = 1
        self.filetypes = vim.eval(
            "get(g:, 'LanguageClient_serverCommands', {})").keys()
        self.input_pattern = r'(\.|::|->)\w*$'

    def gather_candidates(self, context):
        if context["is_async"]:
        self.min_pattern_length = 1
        self.input_pattern = r'(\.|::)\w*'

    def get_complete_position(self, context):
        m = re.search('(?:' + context['keyword_patterns'] + ')*$',
                      context['input'])
        return m.start() if m else -1

    def gather_candidates(self, context):
        if not context["is_async"]:
            context["is_async"] = True
                return candidates
        else:
            context["is_async"] = True
            self.vim.command("let {} = []".format(COMPLETE_OUTPUTS))
            character = (context["complete_position"]
                         + len(context["complete_str"]))
            self.vim.funcs.LanguageClient_omniComplete({
                "character": character,
                "complete_position": context["complete_position"],
            })
        return []

<MSG> Cherry pick b85ff8e25f55befc049d9c98453b329abaa71b15.

<DFF> @@ -21,11 +21,6 @@ class Source(Base):
         self.min_pattern_length = 1
         self.input_pattern = r'(\.|::)\w*'
 
-    def get_complete_position(self, context):
-        m = re.search('(?:' + context['keyword_patterns'] + ')*$',
-                      context['input'])
-        return m.start() if m else -1
-
     def gather_candidates(self, context):
         if not context["is_async"]:
             context["is_async"] = True

{'addition_count': 0, 'commit_subject': 'Cherry pick b85ff8e25f55befc049d9c98453b329abaa71b15.', 'deletion_count': 5, 'file_extension': '.py', 'lang': 'py', 'license': 'mit', 'repo_name': 'autozimu/LanguageClient-neovim'}