Skip to content
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

Enable new inline rename by default #62992

Merged
merged 12 commits into from
Aug 25, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

namespace Microsoft.CodeAnalysis.Editor.InlineRename
{
internal sealed class InlineRenameExperimentationOptions
internal sealed class InlineRenameUIOptions
{
public static readonly Option2<bool> UseInlineAdornment = new(
feature: "InlineRenameExperimentation",
feature: "InlineRename",
name: "UseInlineAdornment",
defaultValue: false,
storageLocation: new FeatureFlagStorageLocation("Roslyn.UseInlineAdornmentForRename"));
defaultValue: true,
storageLocation: new FeatureFlagStorageLocation("Roslyn.Rename_UseInlineAdornment"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void UpdateAdornments()
{
_dashboardColorUpdater?.UpdateColors();

var useInlineAdornment = _globalOptionService.GetOption(InlineRenameExperimentationOptions.UseInlineAdornment);
var useInlineAdornment = _globalOptionService.GetOption(InlineRenameUIOptions.UseInlineAdornment);
if (useInlineAdornment)
{
if (!_textView.HasAggregateFocus)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:options="clr-namespace:Microsoft.VisualStudio.LanguageServices.Implementation.Options;assembly=Microsoft.VisualStudio.LanguageServices.Implementation"
xmlns:local="clr-namespace:Microsoft.VisualStudio.LanguageServices.CSharp.Options"
xmlns:system="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d" d:DesignHeight="500" d:DesignWidth="500">

<ScrollViewer VerticalScrollBarVisibility="Auto">
<ScrollViewer.Resources>
<system:Boolean x:Key="True">True</system:Boolean>
<system:Boolean x:Key="False">False</system:Boolean>
</ScrollViewer.Resources>

<!-- We have a Margin here, to get some distance to the Scrollbar See: https://github.com/dotnet/roslyn/issues/14979-->
<StackPanel Margin="0,0,3,0">
<GroupBox x:Uid="AnalysisGroupBox"
Expand Down Expand Up @@ -83,6 +89,16 @@
<StackPanel>
<CheckBox x:Name="Rename_asynchronously_exerimental"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Rename_asynchronously_experimental}" />

<Label x:Name="Rename_UI_setting_label" Content="{x:Static local:AdvancedOptionPageStrings.Where_should_the_rename_ui_be_shown}" />
Copy link
Member

Choose a reason for hiding this comment

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

a bit odd that ui is lowercased.

Copy link
Member

Choose a reason for hiding this comment

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

maybe just Rename textbox location: inline/in-top-right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's not completely accurate though. It's a bit more nuanced than that. At most, inline rename options or dashboard them?

<ComboBox x:Name="Rename_UI_setting">
<ComboBoxItem x:Name="Rename_UI_inline"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Show_ui_inline}"
Tag="{StaticResource True}" />
<ComboBoxItem x:Name="Rename_UI_dashboard"
Content="{x:Static local:AdvancedOptionPageStrings.Option_Show_ui_as_dashboard_in_top_right}"
Tag="{StaticResource False}" />
</ComboBox>
</StackPanel>
</GroupBox>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Microsoft.CodeAnalysis.Editor.Implementation.Suggestions;
using Microsoft.CodeAnalysis.Editor.InlineDiagnostics;
using Microsoft.CodeAnalysis.Editor.InlineHints;
using Microsoft.CodeAnalysis.Editor.InlineRename;
using Microsoft.CodeAnalysis.Editor.Shared.Options;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.ExtractMethod;
Expand Down Expand Up @@ -73,6 +74,7 @@ public AdvancedOptionPageControl(OptionStore optionStore, IComponentModel compon

// Rename
BindToOption(Rename_asynchronously_exerimental, InlineRenameSessionOptionsStorage.RenameAsynchronously);
BindToOption(Rename_UI_setting, InlineRenameUIOptions.UseInlineAdornment, label: Rename_UI_setting_label);

// Using Directives
BindToOption(PlaceSystemNamespaceFirst, GenerationOptions.PlaceSystemNamespaceFirst, LanguageNames.CSharp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,14 @@ public static string Option_Rename

public static string Option_Rename_asynchronously_experimental
=> ServicesVSResources.Rename_asynchronously_experimental;

public static string Where_should_the_rename_ui_be_shown
=> ServicesVSResources.Where_should_the_rename_ui_be_shown;

public static string Option_Show_ui_inline
=> ServicesVSResources.Show_ui_inline;

public static string Option_Show_ui_as_dashboard_in_top_right
=> ServicesVSResources.Show_ui_as_dashboard_in_top_right;
}
}
6 changes: 0 additions & 6 deletions src/VisualStudio/Core/Def/PackageRegistration.pkgdef
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
"Title"="Run C#/VB code analysis on .Net 6 (requires restart)"
"PreviewPaneChannels"="IntPreview,int.main"

[$RootKey$\FeatureFlags\Roslyn\UseInlineAdornmentForRename]
"Description"="Use the new inline rename experience that changes the UI to be closer to the invocation point."
"Value"=dword:00000000
"Title"="C#/VB enable new inline rename"
"PreviewPaneChannels"="IntPreview,int.main"

// Corresponds to WellKnownExperimentNames.LspPullDiagnosticsFeatureFlag
[$RootKey$\FeatureFlags\Lsp\PullDiagnostics]
"Description"="Enables the LSP-powered diagnostics for managed .Net projects"
Expand Down
9 changes: 9 additions & 0 deletions src/VisualStudio/Core/Def/ServicesVSResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2004,4 +2004,13 @@ Additional information: {1}</value>
<data name="Document_Outline" xml:space="preserve">
<value>Document Outline</value>
</data>
<data name="Show_ui_as_dashboard_in_top_right" xml:space="preserve">
<value>Show UI as a dashboard in top right</value>
ryzngard marked this conversation as resolved.
Show resolved Hide resolved
</data>
<data name="Show_ui_inline" xml:space="preserve">
<value>Show UI Inline</value>
</data>
<data name="Where_should_the_rename_ui_be_shown" xml:space="preserve">
<value>Where should the rename UI be shown?</value>
</data>
</root>
15 changes: 15 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading