Skip to content

Commit 3db308f

Browse files
Revert "Revert "Stop using the rename dashboard"" (#77774)
2 parents b5c3ea8 + 21463b5 commit 3db308f

File tree

49 files changed

+91
-2528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+91
-2528
lines changed

src/EditorFeatures/Core.Wpf/InlineRename/CommandHandlers/RenameCommandHandler.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ internal partial class RenameCommandHandler(
3838
IAsynchronousOperationListenerProvider asynchronousOperationListenerProvider)
3939
: AbstractRenameCommandHandler(threadingContext, renameService, globalOptionService, asynchronousOperationListenerProvider.GetListener(FeatureAttribute.Rename))
4040
{
41-
protected override bool AdornmentShouldReceiveKeyboardNavigation(ITextView textView)
42-
=> GetAdornment(textView) switch
43-
{
44-
RenameDashboard dashboard => dashboard.ShouldReceiveKeyboardNavigation,
45-
RenameFlyout => true, // Always receive keyboard navigation for the inline adornment
46-
_ => false
47-
};
48-
4941
protected override void SetFocusToTextView(ITextView textView)
5042
{
5143
(textView as IWpfTextView)?.VisualElement.Focus();
@@ -59,22 +51,6 @@ protected override void SetFocusToAdornment(ITextView textView)
5951
}
6052
}
6153

62-
protected override void SetAdornmentFocusToNextElement(ITextView textView)
63-
{
64-
if (GetAdornment(textView) is RenameDashboard dashboard)
65-
{
66-
dashboard.FocusNextElement();
67-
}
68-
}
69-
70-
protected override void SetAdornmentFocusToPreviousElement(ITextView textView)
71-
{
72-
if (GetAdornment(textView) is RenameDashboard dashboard)
73-
{
74-
dashboard.FocusNextElement();
75-
}
76-
}
77-
7854
private static InlineRenameAdornment? GetAdornment(ITextView textView)
7955
{
8056
// If our adornment layer somehow didn't get composed, GetAdornmentLayer will throw.

src/EditorFeatures/Core.Wpf/InlineRename/UI/Adornment/RenameFlyout.xaml.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,15 @@ internal partial class RenameFlyout : InlineRenameAdornment
2626
private const int DefaultMinWidth = 200;
2727

2828
private readonly RenameFlyoutViewModel _viewModel;
29-
private readonly IEditorFormatMap _editorFormatMap;
3029
private readonly IWpfTextView _textView;
31-
private readonly IWpfThemeService? _wpfThemeService;
3230
private readonly IAsyncQuickInfoBroker _asyncQuickInfoBroker;
3331
private readonly IAsynchronousOperationListener _listener;
3432
private readonly IThreadingContext _threadingContext;
3533

3634
public RenameFlyout(
3735
RenameFlyoutViewModel viewModel,
3836
IWpfTextView textView,
39-
IWpfThemeService? themeService,
4037
IAsyncQuickInfoBroker asyncQuickInfoBroker,
41-
IEditorFormatMapService editorFormatMapService,
4238
IThreadingContext threadingContext,
4339
IAsynchronousOperationListenerProvider listenerProvider)
4440
{
@@ -50,11 +46,11 @@ public RenameFlyout(
5046
_textView.ViewportWidthChanged += TextView_ViewPortChanged;
5147
_listener = listenerProvider.GetListener(FeatureAttribute.InlineRenameFlyout);
5248
_threadingContext = threadingContext;
53-
_wpfThemeService = themeService;
5449

5550
RenameUserInput = _viewModel.SmartRenameViewModel is null ? new RenameUserInputTextBox(_viewModel) : new SmartRenameUserInputComboBox(_viewModel);
5651

5752
// On load focus the first tab target
53+
var token1 = _listener.BeginAsyncOperation(nameof(RenameUserInput.GotFocus));
5854
Loaded += (s, e) =>
5955
{
6056
// Wait until load to position adornment for space negotiation
@@ -64,6 +60,7 @@ public RenameFlyout(
6460
RenameUserInput.SelectText(_viewModel.StartingSelection.Start, _viewModel.StartingSelection.Length);
6561
RenameUserInput.TextSelectionChanged += RenameUserInput_TextSelectionChanged;
6662
RenameUserInput.GotFocus += RenameUserInput_GotFocus;
63+
token1.Dispose();
6764
};
6865

6966
InitializeComponent();
@@ -79,14 +76,12 @@ public RenameFlyout(
7976
MainPanel.Children.Insert(index + 1, smartRenameControl);
8077
}
8178

82-
_editorFormatMap = editorFormatMapService.GetEditorFormatMap("text");
83-
8479
// Dismiss any current tooltips. Note that this does not disable tooltips
8580
// from showing up again, so if a user has the mouse unmoved another
8681
// tooltip will pop up. https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1611398
8782
// tracks when we can handle this with IFeaturesService in VS
88-
var token = _listener.BeginAsyncOperation(nameof(DismissToolTipsAsync));
89-
_ = DismissToolTipsAsync().CompletesAsyncOperation(token);
83+
var token2 = _listener.BeginAsyncOperation(nameof(DismissToolTipsAsync));
84+
_ = DismissToolTipsAsync().CompletesAsyncOperation(token2);
9085
}
9186

9287
internal IRenameUserInput RenameUserInput { get; }
Binary file not shown.
Binary file not shown.

src/EditorFeatures/Core.Wpf/InlineRename/UI/Dashboard/RenameDashboard.xaml

Lines changed: 0 additions & 256 deletions
This file was deleted.

0 commit comments

Comments
 (0)