feat(cli): add public completion parsing API for external autocompletion#20
feat(cli): add public completion parsing API for external autocompletion#20JKamsker wants to merge 5 commits intospectreconsole:mainfrom
Conversation
c1c53bf to
f202650
Compare
|
@JKamsker Looks good! Would need to have some test coverage, though, before we can get this merged. |
58958f7 to
55114fd
Compare
|
Thanks for the quick reply @patriksvensson ! I have added some tests (i hope they suffice 😅 ) and i am confident the pr is ready for review |
|
Hey @patriksvensson is there anything i can do to get this across the finishing line? |
|
@JKamsker I haven't got around to review this yet. Will try to do it in the upcoming week. Sorry about this. |
|
Thank you for the response, @patriksvensson! As a side note: I'm not entirely convinced that registering |
This PR adds a tiny, additive public surface to
Spectre.Console.Cliso third-party autocompletion can work without reflection or internals access.Why
External projects (e.g. my autocompletion lib on branch
fix/autocomplete-public-api) previously had to use reflection/internal types to:What’s included (surgical + additive)
Spectre.Console.Cli.ITypeResolverAccessorto expose the currentITypeResolverduring executionSpectre.Console.Cli.Completion.CommandLineParser+CommandLineParseResult+CommandLineMappedParameterto parse args against the command model and return:Help.ICommandInfo?CommandType/SettingsTypeICommandParameterInfo+ value pairsInternal/CommandExecutor.csto register:ICommandAppSettingsHelp.ICommandModelITypeResolverAccessor(populated for the lifetime of the resolver)Consumer reference
JKToolKit autocompletion refactor using only public contracts
Notes