def reparse(self): currentFile = self.view.file_name() cmd = ms.setting("moonc_cmd", "moonc") args = [cmd, "-T", currentFile] out, err, _ = ms.runcmd(args) if len(out) == 0: return self.sugs # print 'out->' + out out = PAT_PARSE.sub(pat_parse_repl, out) # print 'out->' + out tree = eval(out[:-1]) # print 'tree->' + str(tree) self.sugs = [] self.parse(tree, 1) self.sugs = uniq(self.sugs)
def is_moonscript(self, view): print view.scope_name(0) pos = 0 if self.locations: pos = self.locations[0] scopes = view.scope_name(pos).split() if ("source.moonscript" not in scopes) or (ms.setting("ms_complete_enabled", False) is not True): return False return True