示例#1
0
    def getCompletions(self, text, act_tok):
        try:
            ipython_completion = text.startswith("%")
            if not ipython_completion:
                s = re.search(r"\bcd\b", text)
                if s is not None and s.start() == 0:
                    ipython_completion = True

            if ipython_completion:
                TYPE_LOCAL = "9"
                _line, completions = self.interpreter.complete(text)

                ret = []
                append = ret.append
                for completion in completions:
                    append((completion, "", "", TYPE_LOCAL))
                return ret

            # Otherwise, use the default PyDev completer (to get nice icons)
            from _completer import Completer

            completer = Completer(self.getNamespace(), None)
            return completer.complete(act_tok)
        except:
            import traceback

            traceback.print_exc()
            return []
    def getCompletions(self, text, act_tok):
        try:
            ipython_completion = text.startswith('%')
            if not ipython_completion:
                s = re.search(r'\bcd\b', text)
                if s is not None and s.start() == 0:
                    ipython_completion = True

            if ipython_completion:
                TYPE_LOCAL = '9'
                _line, completions = self.interpreter.complete(text)

                ret = []
                append = ret.append
                for completion in completions:
                    append((completion, '', '', TYPE_LOCAL))
                return ret

            #Otherwise, use the default PyDev completer (to get nice icons)
            from _completer import Completer
            completer = Completer(self.getNamespace(), None)
            return completer.complete(act_tok)
        except:
            import traceback
            traceback.print_exc()
            return []
示例#3
0
 def getCompletions(self, text, act_tok):
     try:
         from _completer import Completer
         completer = Completer(self.namespace, None)
         return completer.complete(act_tok)
     except:
         import traceback;traceback.print_exc()
         return []
示例#4
0
 def getCompletions(self, text):
     try:
         from _completer import Completer
         completer = Completer(self.namespace, None)
         return completer.complete(text)
     except:
         import traceback
         traceback.print_exc()
         return []
    def getCompletions(self, text, act_tok):
        try:
            ipython_completion = text.startswith('%')
            if not ipython_completion:
                s = re.search(r'\bcd\b', text)
                if s is not None and s.start() == 0:
                    ipython_completion = True

            if text is None:
                text = ""

            TYPE_LOCAL = '9'
            _line, completions = self.interpreter.complete(text)

            ret = []
            append = ret.append
            for completion in completions:
                if completion.startswith('%'):
                    append((completion[1:], '', '%', TYPE_LOCAL))
                else:
                    append((completion, '', '', TYPE_LOCAL))

            if ipython_completion:
                return ret

            #Otherwise, use the default PyDev completer (to get nice icons)
            from _completer import Completer

            completer = Completer(self.getNamespace(), None)
            completions = completer.complete(act_tok)
            cset = set()
            for c in completions:
                cset.add(c[0])
            for c in ret:
                if c[0] not in cset:
                    completions.append(c)

            return completions

        except:
            import traceback

            traceback.print_exc()
            return []
    def getCompletions(self, text, act_tok):
        try:
            ipython_completion = text.startswith('%')
            if not ipython_completion:
                s = re.search(r'\bcd\b', text)
                if s is not None and s.start() == 0:
                    ipython_completion = True

            if text is None:
                text = ""

            TYPE_LOCAL = '9'
            _line, completions = self.interpreter.complete(text)

            ret = []
            append = ret.append
            for completion in completions:
                if completion.startswith('%'):
                    append((completion[1:], '', '%', TYPE_LOCAL))
                else:
                    append((completion, '', '', TYPE_LOCAL))

            if ipython_completion:
                return ret

            #Otherwise, use the default PyDev completer (to get nice icons)
            from _completer import Completer

            completer = Completer(self.getNamespace(), None)
            completions = completer.complete(act_tok)
            cset = set()
            for c in completions:
                cset.add(c[0])
            for c in ret:
                if c[0] not in cset:
                    completions.append(c)

            return completions

        except:
            import traceback

            traceback.print_exc()
            return []
示例#7
0
 def getCompletions(self, text):
     from _completer import Completer
     completer = Completer(self.namespace, None)
     return completer.complete(text)
示例#8
0
 def getCompletions(self, text):
     from _completer import Completer
     completer = Completer(self.namespace, None)
     return completer.complete(text)