import sys if __name__ == '__main__': """ Server process' entry point """ # setup argument parser and parse command line args parser = argparse.ArgumentParser() parser.add_argument("port", help="the local tcp port to use to run " "the server") parser.add_argument('-s', '--syspath', nargs='*') args = parser.parse_args() # add user paths to sys.path if args.syspath: for path in args.syspath: print('append path %s to sys.path\n' % path) sys.path.append(path) from pyqode.core import backend from pyqode.python.backend.workers import JediCompletionProvider # setup completion providers backend.CodeCompletionWorker.providers.append(JediCompletionProvider()) backend.CodeCompletionWorker.providers.append( backend.DocumentWordsProvider()) # starts the server backend.serve_forever(args)
def complete(code, line, column, path, encoding, prefix): code = _console_mode_header + code return JediCompletionProvider.complete(code, line + _header_num_lines, column, path, encoding, prefix)