MCPcopy
hub / github.com/pallets/click / get_completions

Method get_completions

src/click/shell_completion.py:292–304  ·  view source on GitHub ↗

Determine the context and last complete command or parameter from the complete args. Call that object's ``shell_complete`` method to get the completions for the incomplete value. :param args: List of complete args before the incomplete value. :param incomplete: Value

(
        self, args: list[str], incomplete: str
    )

Source from the content-addressed store, hash-verified

290 raise NotImplementedError
291
292 def get_completions(
293 self, args: list[str], incomplete: str
294 ) -> list[CompletionItem[str]]:
295 """Determine the context and last complete command or parameter
296 from the complete args. Call that object's ``shell_complete``
297 method to get the completions for the incomplete value.
298
299 :param args: List of complete args before the incomplete value.
300 :param incomplete: Value being completed. May be empty.
301 """
302 ctx = _resolve_context(self.cli, self.ctx_args, self.prog_name, args)
303 obj, incomplete = _resolve_incomplete(ctx, args, incomplete)
304 return obj.shell_complete(ctx, incomplete)
305
306 def format_completion(self, item: CompletionItem[str]) -> str:
307 """Format a completion item into the form recognized by the

Callers 2

completeMethod · 0.95
_get_completionsFunction · 0.95

Calls 3

_resolve_contextFunction · 0.85
_resolve_incompleteFunction · 0.85
shell_completeMethod · 0.45

Tested by 1

_get_completionsFunction · 0.76