Skip to content

Commit 1538f0d

Browse files
committed
Merge pull request #5 from corvisa/fix-missing-hooks
Fix completions not working on a new load of sublime
2 parents 85ae223 + 4814e59 commit 1538f0d

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

completions.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ def load_completions(self):
5858
self.obj_types[obj] = module['objects'][obj]
5959

6060
def default_imports(self):
61+
self.load_completions()
62+
6163
return self.completions['imports']
6264

6365
def find_return_types(self, symbol, imports, objects):
@@ -71,6 +73,8 @@ def find_return_types(self, symbol, imports, objects):
7173
if symbol is None or imports is None or len(imports) == 0:
7274
return None
7375

76+
self.load_completions()
77+
7478
self_parts = symbol.split(':')
7579
sym_parts = self_parts[0].split('.')
7680
obj_name = '.'.join(sym_parts[:1])
@@ -129,6 +133,8 @@ def find_completions(self, view, prefix, imports, objects):
129133
if completion_target.endswith('.') or completion_target.endswith(':'):
130134
completion_target = completion_target[:-1]
131135

136+
self.load_completions()
137+
132138
comps = []
133139
used_names = set()
134140

@@ -216,7 +222,9 @@ def current_word(self, view):
216222

217223
class CompletionsListener(SummitCompletions, sublime_plugin.EventListener):
218224
def __init__(self):
219-
super().__init__()
225+
# Don't do super().__init__() or even try to do
226+
# SummitCompletions.__init__(self) here because apparently it causes
227+
# Sublime to not hook the event methods...?
220228

221229
self.periods_set = {}
222230
self.default_separators = ''

0 commit comments

Comments
 (0)