diff --git a/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml b/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml
index 0491499e7f537..5c0518f50525d 100644
--- a/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml
+++ b/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameUserInputComboBox.xaml
@@ -87,7 +87,6 @@
-
diff --git a/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameViewModel.cs b/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameViewModel.cs
index 64519f8f64cdb..fbb4afed7d98e 100644
--- a/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameViewModel.cs
+++ b/src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameViewModel.cs
@@ -92,7 +92,13 @@ public string? SelectedSuggestedName
}
}
- public bool IsSuggestionsPanelExpanded => HasSuggestions;
+ ///
+ /// IsSuggestionsPanelExpanded is used to control the visibility of the suggestions panel.
+ /// SupportsAutomaticSuggestions the flag to determine whether the SmartRename will generate suggestion automatically.
+ /// When SupportsAutomaticSuggestions disenabled, the suggestions panel is supposed to always expanded once it's shown, thus users can see the suggestions.
+ /// When SupportsAutomaticSuggestions enabled, the suggestions panel is supposed to react to the smart rename button click. If the button is clicked, IsAutomaticSuggestionsEnabled will be true, the panel will be expanded, Otherwise, it will be collapsed.
+ ///
+ public bool IsSuggestionsPanelExpanded => HasSuggestions && (!SupportsAutomaticSuggestions || IsAutomaticSuggestionsEnabled);
public string GetSuggestionsTooltip
=> SupportsAutomaticSuggestions
@@ -286,7 +292,7 @@ public void ToggleOrTriggerSuggestions()
{
this.FetchSuggestions(isAutomaticOnInitialization: false);
}
-
+ NotifyPropertyChanged(nameof(IsSuggestionsPanelExpanded));
NotifyPropertyChanged(nameof(IsAutomaticSuggestionsEnabled));
// Use existing "CollapseSuggestionsPanel" option (true if user does not wish to get suggestions automatically) to honor user's choice.
_globalOptionService.SetGlobalOption(InlineRenameUIOptionsStorage.CollapseSuggestionsPanel, !IsAutomaticSuggestionsEnabled);