Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 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)
Example #6
0
 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)
Example #7
0
 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
Example #8
0
 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
Example #9
0
 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
Example #10
0
 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
Example #11
0
 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