Repository navigation
[VS] Rename: dialog in XAML, no exception for a renamed file in the project tree - #2163
Merged
Merged
Conversation
…roject tree - The rename dialog is defined in XAML (RenameDialog.xaml) instead of being built in code; both LanguageService projects include it. It now uses the VS theme like the other X# windows. - XSharpProjectTreePropertiesProvider: while a file is renamed the tree can still ask for the old path; return early when the file does not exist instead of throwing (and catching) a FileNotFoundException in FindClassDeclaration. Follow-up to X-Sharp#2154 (review comments). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2154, for the two review comments there.
Depends on #2161:
devdoes not compile at the moment (FindReferencesCommand.csafter the merge of #2154 and #2156). This branch is based ondevand builds once #2161 is merged.Changes
Rename/RenameDialog.xaml(aDialogWindow,x:ClassModifier="internal") replaces the dialog that was built in code; the code-behind keeps only what depends on the symbol (title, late-bound option text, initial values, visibility, events). Both LanguageService projects (VS 2019 and VS 2022) include it as aPage. The interface used byRenameCommandis unchanged.toolkit:Themes.UseVsTheme), like the other X# windows, so it is dark in the dark theme. The title bar is still drawn by Windows.XSharpProjectTreePropertiesProviderfor the icon of the old path.InferSubTypeFromBaseClassnow returns early when the file does not exist, instead ofFindClassDeclarationthrowing aFileNotFoundExceptionthat was caught. Thecatchstays for the race between the check and the read.Tests
LanguageService.Tests: 174/174 passed..designer.prg): rename of the form class with "Rename file" renames both files and all references; the dialog shows correctly in the dark theme. With the debugger attached and break on thrownSystem.IO.FileNotFoundException, no break inFindClassDeclaration.🤖 Generated with Claude Code