MCPcopy Index your code
hub / github.com/RustPython/RustPython / complete

Method complete

Lib/rlcompleter.py:70–100  ·  view source on GitHub ↗

Return the next possible completion for 'text'. This is called successively with state == 0, 1, 2, ... until it returns None. The completion should begin with 'text'.

(self, text, state)

Source from the content-addressed store, hash-verified

68 self.namespace = namespace
69
70 def complete(self, text, state):
71 """Return the next possible completion for 'text'.
72
73 This is called successively with state == 0, 1, 2, ... until it
74 returns None. The completion should begin with 'text'.
75
76 """
77 if self.use_main_ns:
78 self.namespace = __main__.__dict__
79
80 if not text.strip():
81 if state == 0:
82 if _readline_available:
83 readline.insert_text('\t')
84 readline.redisplay()
85 return ''
86 else:
87 return '\t'
88 else:
89 return None
90
91 if state == 0:
92 with warnings.catch_warnings(action="ignore"):
93 if "." in text:
94 self.matches = self.attr_matches(text)
95 else:
96 self.matches = self.global_matches(text)
97 try:
98 return self.matches[state]
99 except IndexError:
100 return None
101
102 def _callable_postfix(self, val, word):
103 if callable(val):

Callers 5

test_uncreated_attrMethod · 0.95
test_completeMethod · 0.95

Calls 4

attr_matchesMethod · 0.95
global_matchesMethod · 0.95
insert_textMethod · 0.80
stripMethod · 0.45

Tested by 5

test_uncreated_attrMethod · 0.76
test_completeMethod · 0.76