def cgo_completion(self, buffer): # No include header if cgo.get_inline_source(buffer)[0] == 0: return count, inline_source = cgo.get_inline_source(buffer) # exists 'self.cgo_inline_source', same inline sources and # already cached cgo complete candidates if ( self.cgo_inline_source is not None and self.cgo_inline_source == inline_source and self.cgo_cache[self.cgo_inline_source] ): # Use in-memory(self.cgo_headers) cacahe return self.cgo_cache[self.cgo_inline_source] else: self.cgo_inline_source = inline_source # return candidates use libclang-python3 return cgo.complete( self.index, self.cgo_cache, self.cgo_options, count, self.cgo_inline_source, )
def cgo_completion(self, buffer): # No include header if cgo.get_inline_source(buffer)[0] == 0: return count, inline_source = cgo.get_inline_source(buffer) # exists 'self.cgo_inline_source', same inline sources and # already cached cgo complete candidates if self.cgo_inline_source is not None and \ self.cgo_inline_source == inline_source and \ self.cgo_cache[self.cgo_inline_source]: # Use in-memory(self.cgo_headers) cacahe return self.cgo_cache[self.cgo_inline_source] else: self.cgo_inline_source = inline_source # return candidates use libclang-python3 return cgo.complete( self.index, self.cgo_cache, self.cgo_options, count, self.cgo_inline_source )