I implemented a SublimeText autocompletion plugin:
import sublime_plugin
import sublime
tensorflow_functions = ["tf.test","tf.AggregationMethod","tf.Assert","tf.AttrValue", (etc....)]
class TensorflowAutocomplete(sublime_plugin.EventListener):
def __init__(self):
self.tf_completions = [("%s \tTensorflow" % s, s) for s in tensorflow_functions]
def on_query_completions(self, view, prefix, locations):
if view.match_selector(locations[0], 'source.python'):
return self.tf_completions
else:
return[]
It works great but the problem is when I type a "." it resets the completion suggestions.
For example I type "tf" it suggests me all my custom list but then I type "tf." it suggests me a list as I didn't type "tf" before. I want my script to take consideration of what was typed before dots.
It's hard to explain. Do you have any idea what I need to do?
EDIT :
Here's what it does:
You can see here that "tf" isn't highlighted.