Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Make dotnet project convert interactive - #49660

#49660
Merged
jjonescz merged 15 commits into
dotnet:maindotnet/sdk:mainfrom
jjonescz:sprint-convert-interactivejjonescz/dotnet-sdk:sprint-convert-interactiveCopy head branch name to clipboard
Jul 15, 2025
Merged

Make dotnet project convert interactive#49660
jjonescz merged 15 commits into
dotnet:maindotnet/sdk:mainfrom
jjonescz:sprint-convert-interactivejjonescz/dotnet-sdk:sprint-convert-interactiveCopy head branch name to clipboard

Conversation

@jjonescz

@jjonescz jjonescz commented Jul 4, 2025

Copy link
Copy Markdown
Member

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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") )

Comment thread src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf Outdated
@RikkiGibson

Copy link
Copy Markdown
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
Copy Markdown
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

jjonescz commented Jul 9, 2025

Copy link
Copy Markdown
Member Author

@dotnet/run-file for reviews, thanks

@RikkiGibson RikkiGibson self-assigned this Jul 9, 2025
Comment thread src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs
Comment thread src/Cli/dotnet/InteractiveConsole.cs
Comment thread src/Cli/dotnet/CommonOptions.cs
Comment thread src/Cli/dotnet/InteractiveConsole.cs
Comment thread src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs Outdated
Comment thread test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs Outdated

@RikkiGibson RikkiGibson left a comment

Copy link
Copy Markdown
Member

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

@RikkiGibson RikkiGibson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great thanks!

@jjonescz

jjonescz commented Jul 11, 2025

Copy link
Copy Markdown
Member Author

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

@jjonescz

Copy link
Copy Markdown
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

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.