def on_query_completions(self, view, prefix, locations):
    default_completions = [(item + "\tDefault", item) for sublist in [view.extract_completions(prefix)]
     for item in sublist if len(item) > 3]
    default_completions = list(set(default_completions))

    line_region = view.line(sublime.Region(locations[0]))
    line = str(view.substr(line_region))[:locations[0] - line_region.a]

    completions = [(x, x) for x in auto_complete.get_completions(line)]
    completions.extend(default_completions)
    return (completions, sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS)
Ejemplo n.º 2
0
 def test_get_completions_with_partial_match_of_child_ns(self):
   self.assertEquals(["ns11", "ns12"], auto_complete.get_completions("ns1.ns"))
Ejemplo n.º 3
0
 def test_get_completions_with_partial_match_of_root_ns(self):
   self.assertEquals(["ns1"], auto_complete.get_completions("n"))
Ejemplo n.º 4
0
 def test_get_completions_with_full_match_of_long_ns(self):
   self.assertEquals(["ns121", "ns122"], auto_complete.get_completions("ns1.ns12"))
Ejemplo n.º 5
0
 def test_get_completions_with_full_match_of_single_ns(self):
   self.assertEquals(["ns11", "ns12"], auto_complete.get_completions("ns1"))
Ejemplo n.º 6
0
 def test_get_completions_with_no_match(self):
   self.assertEquals([], auto_complete.get_completions("nomatch"))