def get_completions(self, request, response): src = request['src'] contents = request['contents'] line = request['line'] column = request['column'] prefix = request['prefix'] token_start_column = request['tokenStartColumn'] flags = request['flags'] # Update the translation unit with the latest contents. translation_unit = self._tryUpdateTranslationUnit(src, contents, flags) if translation_unit: completions = get_completions( translation_unit, src, line + 1, token_start_column + 1, prefix, contents) else: completions = [] response['file'] = src response['completions'] = completions response['line'] = line response['column'] = column response['prefix'] = prefix
def get_completions(self, request, response): src = request['src'] contents = request['contents'] line = request['line'] column = request['column'] prefix = request['prefix'] token_start_column = request['tokenStartColumn'] flags = request['flags'] # NOTE: there is no need to update the translation unit here. # libclang's completions API seamlessly takes care of unsaved content # without any special handling. translation_unit = self._get_translation_unit(src, flags) if translation_unit: completions = get_completions( translation_unit, src, line + 1, token_start_column + 1, prefix, contents, limit=COMPLETIONS_LIMIT) else: completions = [] response['file'] = src response['completions'] = completions response['line'] = line response['column'] = column response['prefix'] = prefix
def get_completions(self, request, response): src = request['src'] contents = request['contents'] line = request['line'] column = request['column'] prefix = request['prefix'] token_start_column = request['tokenStartColumn'] flags = request['flags'] # NOTE: there is no need to update the translation unit here. # libclang's completions API seamlessly takes care of unsaved content # without any special handling. translation_unit = self._get_translation_unit(src, flags) if translation_unit: completions = get_completions(translation_unit, src, line + 1, token_start_column + 1, prefix, contents, limit=COMPLETIONS_LIMIT) else: completions = [] response['file'] = src response['completions'] = completions response['line'] = line response['column'] = column response['prefix'] = prefix