MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / format_completion_message

Method format_completion_message

pycompletionserver.py:136–161  ·  view source on GitHub ↗

Format the completions suggestions in the following format: @@COMPLETIONS(modFile(token,description),(token,description),(token,description))END@@

(self, defFile, completionsList)

Source from the content-addressed store, hash-verified

134 return " "
135
136 def format_completion_message(self, defFile, completionsList):
137 """
138 Format the completions suggestions in the following format:
139 @@COMPLETIONS(modFile(token,description),(token,description),(token,description))END@@
140 """
141 compMsg = []
142 compMsg.append("%s" % defFile)
143 for tup in completionsList:
144 compMsg.append(",")
145
146 compMsg.append("(")
147 compMsg.append(str(self.remove_invalid_chars(tup[0]))) # token
148 compMsg.append(",")
149 compMsg.append(self.remove_invalid_chars(tup[1])) # description
150
151 if len(tup) > 2:
152 compMsg.append(",")
153 compMsg.append(self.remove_invalid_chars(tup[2])) # args - only if function.
154
155 if len(tup) > 3:
156 compMsg.append(",")
157 compMsg.append(self.remove_invalid_chars(tup[3])) # TYPE
158
159 compMsg.append(")")
160
161 return "%s(%s)%s" % (MSG_COMPLETIONS, "".join(compMsg), MSG_END)
162
163
164class Exit(Exception):

Callers 3

test_messageMethod · 0.80
test_messageMethod · 0.80

Calls 3

remove_invalid_charsMethod · 0.95
appendMethod · 0.45
joinMethod · 0.45

Tested by 2

test_messageMethod · 0.64
test_messageMethod · 0.64