Skip to content
Merged
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}" />
<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
12 changes: 12 additions & 0 deletions src/VisualStudio/Core/Def/ServicesVSResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2004,4 +2004,16 @@ 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>
<comment>"UI" is an acronym for "User Interface"</comment>
</data>
<data name="Show_UI_inline" xml:space="preserve">
<value>Show UI Inline</value>
<comment>"UI" is an acronym for "User Interface"</comment>
</data>
<data name="Where_should_the_rename_UI_be_shown" xml:space="preserve">
<value>Where should the rename UI be shown?</value>
<comment>"UI" is an acronym for "User Interface"</comment>
</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