Пример #1
0
    def __init__(self, fsi_path, is_debug=False):
        self._debug = is_debug
        #self.logfiledir = tempfile.gettempdir() + "/log.txt"
        #self.logfile = open(self.logfiledir, "w")
        id = 'vim-' + str(uuid.uuid4())
        command = [fsi_path, '--fsi-server:%s' % id, '--nologo']
        opts = {
            'stdin': PIPE,
            'stdout': PIPE,
            'stderr': PIPE,
            'shell': False,
            'universal_newlines': True
        }
        hidewin.addopt(opts)
        self.p = Popen(command, **opts)

        if is_debug:
            logfiledir = tempfile.gettempdir() + "/fsi-log.txt"
            self.logfile = open(logfiledir, "w")

        self._should_work = True
        self.lines = Queue()
        self.worker = threading.Thread(target=self._work, args=[])
        self.worker.daemon = True
        self.worker.start()
        self.err_worker = threading.Thread(target=self._err_work, args=[])
        self.err_worker.daemon = True
        self.err_worker.start()
        x = self.purge()
        self._current_path = None
Пример #2
0
    def __init__(self, dir, debug=False):
        if debug:
            self.logfiledir = tempfile.gettempdir() + "/log.txt"
            self.logfile = open(self.logfiledir, "w")
        else:
            self.logfile = None

        command = ['mono', dir + '/bin/fsautocomplete.exe']
        opts = {
            'stdin': PIPE,
            'stdout': PIPE,
            'stderr': PIPE,
            'universal_newlines': True
        }
        hidewin.addopt(opts)
        try:
            self.p = Popen(command, **opts)
        except WindowsError:
            self.p = Popen(command[1:], **opts)

        self.debug = debug
        self.switch_to_json()

        self.completion = Interaction(self.p, 3, self.logfile)
        self._finddecl = Interaction(self.p, 1, self.logfile)
        self._tooltip = Interaction(self.p, 1, self.logfile)
        self._helptext = Interaction(self.p, 1, self.logfile)
        self._errors = Interaction(self.p, 3, self.logfile)
        self._project = Interaction(self.p, 3, self.logfile)
        self._getpaths = Interaction(self.p, 1, self.logfile)

        self.worker = threading.Thread(target=self.work, args=(self, ))
        self.worker.daemon = True
        self.worker.start()
Пример #3
0
    def __init__(self, dir, debug=False):
        if debug:
            self.logfiledir = tempfile.gettempdir() + "/log.txt"
            self.logfile = open(self.logfiledir, "w")
        else:
            self.logfile = None

        command = ["mono", dir + "/bin/fsautocomplete.exe"]
        opts = {"stdin": PIPE, "stdout": PIPE, "stderr": PIPE, "universal_newlines": True}
        hidewin.addopt(opts)
        try:
            self.p = Popen(command, **opts)
        except OSError:
            try:
                self.p = Popen(command[1:], **opts)
            except OSError as error:
                msg = "Error encountered while trying to execute %s: %s" % (command[1:], error)
                raise OSError(msg)

        self.debug = debug
        self.switch_to_json()

        self.completion = Interaction(self.p, 3, self.logfile)
        self._finddecl = Interaction(self.p, 1, self.logfile)
        self._tooltip = Interaction(self.p, 1, self.logfile)
        self._helptext = Interaction(self.p, 1, self.logfile)
        self._errors = Interaction(self.p, 3, self.logfile)
        self._project = Interaction(self.p, 3, self.logfile)
        self._getpaths = Interaction(self.p, 1, self.logfile)

        self.worker = threading.Thread(target=self.work, args=(self,))
        self.worker.daemon = True
        self.worker.start()
Пример #4
0
    def __init__(self, dir, debug = False):
        if debug:
            self.logfiledir = tempfile.gettempdir() + "/log.txt"
            self.logfile = open(self.logfiledir, "w")
        else:
            self.logfile = None

        command = ['mono', dir + '/bin/fsautocomplete.exe']
        opts = { 'stdin': PIPE, 'stdout': PIPE, 'stderr': PIPE, 'universal_newlines': True }
        hidewin.addopt(opts)
        try:
            self.p = Popen(command, **opts)
        except WindowsError:
            self.p = Popen(command[1:], **opts)

        self.debug = debug
        self.switch_to_json()

        self.completion = Interaction(self.p, 3, self.logfile)
        self._finddecl = Interaction(self.p, 1, self.logfile)
        self._tooltip = Interaction(self.p, 1, self.logfile)
        self._helptext = Interaction(self.p, 1, self.logfile)
        self._errors = Interaction(self.p, 3, self.logfile)
        self._project = Interaction(self.p, 3, self.logfile)

        self.worker = threading.Thread(target=self.work, args=(self,))
        self.worker.daemon = True
        self.worker.start()
Пример #5
0
    def __init__(self, fsi_path, is_debug = False):
        self._debug = is_debug
        #self.logfiledir = tempfile.gettempdir() + "/log.txt"
        #self.logfile = open(self.logfiledir, "w")
        id = 'vim-' + str(uuid.uuid4())
        command = [fsi_path, '--fsi-server:%s' % id, '--nologo']
        opts = { 'stdin': PIPE, 'stdout': PIPE, 'stderr': PIPE, 'shell': False, 'universal_newlines': True }
        hidewin.addopt(opts)

        try:
            self.p = Popen(command, **opts)
        except Exception as e:
            raise Exception ('Error executing fsi.  g:fsharp_interactive_bin="' + fsi_path + '" ' + str(e))

        if is_debug:
            logfiledir = tempfile.gettempdir() + "/fsi-log.txt"
            self.logfile = open(logfiledir, "w")

        self._should_work = True
        self.lines = Queue()
        self.worker = threading.Thread(target=self._work, args=[])
        self.worker.daemon = True
        self.worker.start()
        self.err_worker = threading.Thread(target=self._err_work, args=[])
        self.err_worker.daemon = True
        self.err_worker.start()
        x = self.purge()
        self._current_path = None
Пример #6
0
    def __init__(self, fsi_path):
        #self.logfiledir = tempfile.gettempdir() + "/log.txt"
        #self.logfile = open(self.logfiledir, "w")
        id = 'vim-' + str(uuid.uuid4())
        command = [fsi_path, '--fsi-server:%s' % id, '--nologo']
        opts = {
            'stdin': PIPE,
            'stdout': PIPE,
            'stderr': PIPE,
            'shell': False,
            'universal_newlines': True
        }
        hidewin.addopt(opts)
        self.p = Popen(command, **opts)
        #try:
        #   self.p = Popen(command, **opts)
        #except WindowsError:
        #   self.p = Popen(command[1:], **opts)

        self.should_work = True
        self.lines = Queue.Queue()
        self.worker = threading.Thread(target=self._work, args=[])
        self.worker.daemon = True
        self.worker.start()
        self.err_worker = threading.Thread(target=self._err_work, args=[])
        self.err_worker.daemon = True
        self.err_worker.start()
        x = self.purge()
Пример #7
0
    def __init__(self, fsi_path):
        #self.logfiledir = tempfile.gettempdir() + "/log.txt"
        #self.logfile = open(self.logfiledir, "w")
        id = 'vim-' + str(uuid.uuid4())
        command = [fsi_path, '--fsi-server:%s' % id, '--nologo']
        opts = { 'stdin': PIPE, 'stdout': PIPE, 'stderr': PIPE, 'shell': False, 'universal_newlines': True }
        hidewin.addopt(opts)
        self.p = Popen(command, **opts) 
        #try:
         #   self.p = Popen(command, **opts) 
        #except WindowsError:
         #   self.p = Popen(command[1:], **opts)

        self.should_work = True
        self.lines = Queue.Queue()
        self.worker = threading.Thread(target=self._work, args=[])
        self.worker.daemon = True
        self.worker.start()
        self.err_worker = threading.Thread(target=self._err_work, args=[])
        self.err_worker.daemon = True
        self.err_worker.start()
        x = self.purge()