More work on merging completions with parse tree

This commit is contained in:
Kovid Goyal
2022-09-26 07:34:49 +05:30
parent bf74413c1f
commit 97716fea8b
16 changed files with 263 additions and 426 deletions

View File

@@ -203,7 +203,7 @@ class ArgsHandling:
if c is not None:
yield f'{go_name}.StopCompletingAtArg = {c}'
if self.completion:
yield from self.completion.as_go_code(go_name)
yield from self.completion.as_go_code(go_name + '.ArgCompleter', ' = ')
def as_go_code(self, cmd_name: str, field_types: Dict[str, str], handled_fields: Set[str]) -> Iterator[str]:
c = self.args_count

View File

@@ -73,7 +73,7 @@ If specified the tab containing the window this command is run in is used
instead of the active tab
''' + '\n\n' + launch_options_spec().replace(':option:`launch', ':option:`kitty @ launch')
args = RemoteCommand.Args(spec='[CMD ...]', json_field='args', completion=RemoteCommand.CompletionSpec.from_string(
'type:special group:complete_kitty'))
'type:special group:cli.CompleteExecutableFirstArg'))
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
ans = {'args': args or []}