Skip to content

Remove dotnet-format option parsing and have them pass-through. - #25541

Merged
JoeRobich merged 2 commits into
dotnet:release/6.0.4xxfrom
JoeRobich:remove-format-command-options
May 20, 2022
Merged

JoeRobich merged 2 commits into
dotnet:release/6.0.4xxfrom
JoeRobich:remove-format-command-options

Conversation

@JoeRobich

Copy link
Copy Markdown
Member

This resolves several issues where the dotnet CLI is parsing arguments differently than dotnet-format.

@baronfel

Copy link
Copy Markdown
Member

While this will address the out-of-sync issue reported in dotnet/format#1479, you'll lose the built-in tab-completion support that having the parser inside the SDK CLI provides. You can still get there if users have configured the dotnet-suggest tool, but the rate of users that have done that is probably quite low (based on similar reports of users with .NET CLI tab-completion enabled), and it's one more hurdle. We do hope to centralize the completion story longer term, so eventually you would probably start lighting up support again as we figure that out.

An alternative - if you export a System.CommandLine command then we could simply mount that command in the SDK, like we do for the template engine (which provides the entire dotnet new command and infrastructure). That might have complications with your other desire to allow for dotnet-tool-based usage, though.

@baronfel

Copy link
Copy Markdown
Member

If you do move forward with removing the native parser, you'll also want to add a switch case to this Help writer method to delegate to your help command, so that users get useful help output.

@JoeRobich

Copy link
Copy Markdown
Member Author

you'll lose the built-in tab-completion support that having the parser inside the SDK CLI provides.

@baronfel I've discussed this before with Jon and we believe in the short-term this is the way to go. Ideally System.CommandLine will be imbued with some way to forward suggestion requests in a way that we can share a single command configuration.

@baronfel

Copy link
Copy Markdown
Member

Fair enough. If your app supports the [suggest] directive (which it should if the default pipeline is used), we could do that right now - dotnet suggest calls the suggest directive with a specifically-formatted set of CLI args, and we could do work to support that. That might be an interesting pathway towards being able to use dotnet as a suggestions engine for tools as well. @jonsequitur thoughts on that?

@jmarolf

jmarolf commented May 20, 2022

Copy link
Copy Markdown
Contributor

you'll lose the built-in tab-completion support that having the parser inside the SDK CLI provides.

as @JoeRobich says, the insane complexity that this introduces is simply not worth it. dotnet.exe should forward completion requests to underlying apps in order to provide this.

@JoeRobich
JoeRobich merged commit c03f987 into dotnet:release/6.0.4xx May 20, 2022
@JoeRobich
JoeRobich deleted the remove-format-command-options branch May 20, 2022 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants