Skip to content

Commit

Permalink
Merge pull request #5 from corvisa/fix-missing-hooks
Browse files Browse the repository at this point in the history
Fix completions not working on a new load of sublime
  • Loading branch information
aphistic committed Jan 29, 2015
2 parents 85ae223 + 4814e59 commit 1538f0d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def load_completions(self):
self.obj_types[obj] = module['objects'][obj]

def default_imports(self):
self.load_completions()

return self.completions['imports']

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

self.load_completions()

self_parts = symbol.split(':')
sym_parts = self_parts[0].split('.')
obj_name = '.'.join(sym_parts[:1])
Expand Down Expand Up @@ -129,6 +133,8 @@ def find_completions(self, view, prefix, imports, objects):
if completion_target.endswith('.') or completion_target.endswith(':'):
completion_target = completion_target[:-1]

self.load_completions()

comps = []
used_names = set()

Expand Down Expand Up @@ -216,7 +222,9 @@ def current_word(self, view):

class CompletionsListener(SummitCompletions, sublime_plugin.EventListener):
def __init__(self):
super().__init__()
# Don't do super().__init__() or even try to do
# SummitCompletions.__init__(self) here because apparently it causes
# Sublime to not hook the event methods...?

self.periods_set = {}
self.default_separators = ''
Expand Down

0 comments on commit 1538f0d

Please sign in to comment.