Skip to content

Conversation

@jjonescz
Copy link
Member

@jjonescz jjonescz commented Jul 4, 2025

And allow users to specify whether the files should be copied or moved.

Resolves #49624.

@jjonescz jjonescz added the Area-run-file Items related to the "dotnet run <file>" effort label Jul 4, 2025
@jjonescz jjonescz marked this pull request as ready for review July 4, 2025 15:12
@jjonescz jjonescz requested review from a team and Copilot July 4, 2025 15:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR makes dotnet project convert interactive by adding a --keep-source option and prompting users to confirm or specify output when not provided.

  • Introduces shared InteractiveConsole helpers and an interactive option in common options.
  • Adds KeepSourceOption and wires interactive logic into the parser and command implementation.
  • Updates shell completions, tests, and localization/resx to cover the new interactive behavior.

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Cli/dotnet/InteractiveConsole.cs New helper for interactive prompts (Confirm/Ask)
src/Cli/dotnet/CommonOptions.cs Cache and expose a reusable --interactive option
src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommandParser.cs Add --keep-source option
src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs Implement interactive flow and copy/move logic for keep-source
test/dotnet.Tests/CompletionTests/snapshots/.verified. Update zsh/bash/pwsh completion snapshots for new options
test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs Add and update tests for --keep-source and interactive cases
src/Cli/dotnet/Commands/CliCommandStrings.resx Add new CLI string entries for interactive prompts
src/Cli/dotnet/Commands/xlf/CliCommandStrings.*.xlf Add localization entries for interactive prompts
Comments suppressed due to low confidence (2)

test/dotnet.Tests/CompletionTests/snapshots/zsh/DotnetCliSnapshotTests.VerifyCompletions.verified.zsh:678

  • Zsh completion suggests capitalized False/True, but the CLI expects lowercase false/true. Update to suggest lowercase values to match actual accepted arguments.
                                            '--keep-source=[Whether to keep source files intact (otherwise, they are deleted after conversion).]: :((False\:"False" True\:"True" ))' \

test/dotnet.Tests/CompletionTests/snapshots/bash/DotnetCliSnapshotTests.VerifyCompletions.verified.sh:1190

  • Bash completion suggests False/True but the --keep-source option expects lowercase false/true, so the suggestions should be updated accordingly.
            COMPREPLY=( $(compgen -W "False True" -- "$cur") )

@RikkiGibson
Copy link
Member

Amazing, I was genuinely going to ask for this but thought.. "it's the wrong point in the dev cycle..it's out of left field..etc." Then suddenly here it is.

@DamianEdwards
Copy link
Member

@jjonescz after reading your comment on the issue, I tweaked the option name and choices to better allow for a future where we ask about other items besides source. Interested in your thoughts on the wording in the updated proposal. I think I prefer the new wording and choices?

@jjonescz
Copy link
Member Author

jjonescz commented Jul 9, 2025

@dotnet/run-file for reviews, thanks

@RikkiGibson RikkiGibson self-assigned this Jul 9, 2025
Copy link
Member

@RikkiGibson RikkiGibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo some minor suggestions

Copy link
Member

@RikkiGibson RikkiGibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great thanks!

@jjonescz
Copy link
Member Author

jjonescz commented Jul 11, 2025

After discussing with Damian, to simplify things, we are going to make --source=copy the only behavior and remove the option.

@jjonescz
Copy link
Member Author

@chsienki or @jaredpar for another review, thanks

@jjonescz jjonescz merged commit 681138b into dotnet:main Jul 15, 2025
27 checks passed
@jjonescz jjonescz deleted the sprint-convert-interactive branch July 15, 2025 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-run-file Items related to the "dotnet run <file>" effort

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make dotnet project convert app.cs interactive by default

5 participants