Skip to content

Make dotnet project convert interactive #49660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

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 Copilot and a team July 4, 2025 15:12
Copy link
Contributor

@Copilot 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.

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
2 participants