def completions(self, filename, offset): data = self.sync_call("completions", filename, offset, 0, True, True) if data[0] == ":ok": result = sexpr.to_mapping(data[1]) result.setdefault('completions', []) result['completions'] = [ sexpr.to_mapping(x) for x in result['completions']] return result else: self.printer.err(data)
def on_scala_notes(self, message): notes = sexpr.to_mapping(message[1])['notes'] for note in notes: note = sexpr.to_mapping(note) if note.get('severity') == 'error': print note command = 'caddexpr "%(file)s:%(line)s:%(col)s:%(msg)s"' % note print command try: vim.command(command) except vim.error as e: self.printer.err(e)
def completions(self, filename, offset): data = self.sync_call("completions", filename, offset, 0, True, True) with open('/Users/adr/output.txt', 'ab+') as f: f.write("%s\n\n" % data[1]) if data[0] == ":ok": result = sexpr.to_mapping(data[1]) result.setdefault('completions', []) result['completions'] = [ sexpr.to_mapping(x) for x in result['completions']] return result else: self.printer.err(data)
def completions(self, filename, offset): data = self.sync_call("completions", filename, offset, 0, True, True) with open('/Users/adr/output.txt', 'ab+') as f: f.write("%s\n\n" % data[1]) if data[0] == ":ok": result = sexpr.to_mapping(data[1]) result.setdefault('completions', []) result['completions'] = [ sexpr.to_mapping(x) for x in result['completions'] ] return result else: self.printer.err(data)
def on_scala_notes(self, message): with open('/Users/adr/output.txt', 'ab+') as f: f.write("%s\n\n" % message) notes = sexpr.to_mapping(message[1])['notes'] for note in notes: note = sexpr.to_mapping(note) if note.get('severity') == 'error': print note command = 'caddexpr "%(file)s:%(line)s:%(col)s:%(msg)s"' % note print command try: vim.command(command) except vim.error as e: self.printer.err(e)
def print_result(data): if data[0] == ':ok': result = sexpr.to_mapping(data[1]) self.printer.out(result['full-name']) else: self.printer.err('error while determining symbol: %s' % data) return True
def print_result(data): with open('/Users/adr/output.txt', 'ab+') as f: f.write("%s\n\n" % data[1]) if data[0] == ':ok': result = sexpr.to_mapping(data[1]) self.printer.out(result['full-name']) else: self.printer.err('error while determining symbol: %s' % data) return True
def print_result(data): if data[0] == ':ok': result = sexpr.to_mapping(data[1]) project_name = result['project-name'] if project_name: self.printer.out('initialized %s' % project_name) else: self.printer.out('initialized') else: self.printer.err('cannot initialize project: %s' % data) return True