From 2bd5f92a0b59ecde81ae791991955adb2a40fa09 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 6 Oct 2020 16:03:18 -0700 Subject: [PATCH] Update UI --- ...ineParameterNameHintsDataTaggerProvider.cs | 3 +- ...AbstractInlineParameterNameHintsService.cs | 4 +- .../InlineHints/InlineHintsOptions.cs | 6 +-- .../Options/AdvancedOptionPageControl.xaml | 51 ++++++++++--------- .../Options/AdvancedOptionPageControl.xaml.cs | 6 ++- .../Impl/Options/AdvancedOptionPageStrings.cs | 3 ++ .../Core/Def/ServicesVSResources.resx | 3 ++ .../Core/Def/xlf/ServicesVSResources.cs.xlf | 5 ++ .../Core/Def/xlf/ServicesVSResources.de.xlf | 5 ++ .../Core/Def/xlf/ServicesVSResources.es.xlf | 5 ++ .../Core/Def/xlf/ServicesVSResources.fr.xlf | 5 ++ .../Core/Def/xlf/ServicesVSResources.it.xlf | 5 ++ .../Core/Def/xlf/ServicesVSResources.ja.xlf | 5 ++ .../Core/Def/xlf/ServicesVSResources.ko.xlf | 5 ++ .../Core/Def/xlf/ServicesVSResources.pl.xlf | 5 ++ .../Def/xlf/ServicesVSResources.pt-BR.xlf | 5 ++ .../Core/Def/xlf/ServicesVSResources.ru.xlf | 5 ++ .../Core/Def/xlf/ServicesVSResources.tr.xlf | 5 ++ .../Def/xlf/ServicesVSResources.zh-Hans.xlf | 5 ++ .../Def/xlf/ServicesVSResources.zh-Hant.xlf | 5 ++ .../Options/AdvancedOptionPageControl.xaml | 50 +++++++++--------- .../Options/AdvancedOptionPageControl.xaml.vb | 6 ++- .../Impl/Options/AdvancedOptionPageStrings.vb | 3 ++ 23 files changed, 142 insertions(+), 58 deletions(-) diff --git a/src/EditorFeatures/Core/InlineHints/InlineParameterNameHintsDataTaggerProvider.cs b/src/EditorFeatures/Core/InlineHints/InlineParameterNameHintsDataTaggerProvider.cs index 970d9047046..e7267565651 100644 --- a/src/EditorFeatures/Core/InlineHints/InlineParameterNameHintsDataTaggerProvider.cs +++ b/src/EditorFeatures/Core/InlineHints/InlineParameterNameHintsDataTaggerProvider.cs @@ -61,7 +61,8 @@ protected override ITaggerEventSource CreateEventSource(ITextView textViewOpt, I TaggerEventSources.OnOptionChanged(subjectBuffer, InlineHintsOptions.ForLiteralParameters, TaggerDelay.NearImmediate), TaggerEventSources.OnOptionChanged(subjectBuffer, InlineHintsOptions.ForObjectCreationParameters, TaggerDelay.NearImmediate), TaggerEventSources.OnOptionChanged(subjectBuffer, InlineHintsOptions.ForOtherParameters, TaggerDelay.NearImmediate), - TaggerEventSources.OnOptionChanged(subjectBuffer, InlineHintsOptions.HideForParametersThatMatchMethodIntent, TaggerDelay.NearImmediate)); + TaggerEventSources.OnOptionChanged(subjectBuffer, InlineHintsOptions.HideForParametersThatMatchMethodIntent, TaggerDelay.NearImmediate), + TaggerEventSources.OnOptionChanged(subjectBuffer, InlineHintsOptions.HideForParametersThatDifferOnlyBySuffix, TaggerDelay.NearImmediate)); } protected override IEnumerable GetSpansToTag(ITextView textView, ITextBuffer subjectBuffer) diff --git a/src/Features/Core/Portable/InlineHints/AbstractInlineParameterNameHintsService.cs b/src/Features/Core/Portable/InlineHints/AbstractInlineParameterNameHintsService.cs index 3028660d96f..80ca2369ab1 100644 --- a/src/Features/Core/Portable/InlineHints/AbstractInlineParameterNameHintsService.cs +++ b/src/Features/Core/Portable/InlineHints/AbstractInlineParameterNameHintsService.cs @@ -35,7 +35,7 @@ public async Task> GetInlineParameterNameHin if (!literalParameters && !objectCreationParameters && !otherParameters) return ImmutableArray.Empty; - var hideForParametersThatDifferBySuffix = options.GetOption(InlineHintsOptions.HideForParametersThatDifferBySuffix); + var hideForParametersThatDifferOnlyBySuffix = options.GetOption(InlineHintsOptions.HideForParametersThatDifferOnlyBySuffix); var hideForParametersThatMatchMethodIntent = options.GetOption(InlineHintsOptions.HideForParametersThatMatchMethodIntent); var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); @@ -60,7 +60,7 @@ public async Task> GetInlineParameterNameHin void AddHintsIfAppropriate() { - if (hideForParametersThatDifferBySuffix && ParametersDifferOnlyBySuffix(buffer)) + if (hideForParametersThatDifferOnlyBySuffix && ParametersDifferOnlyBySuffix(buffer)) return; foreach (var hint in buffer) diff --git a/src/Features/Core/Portable/InlineHints/InlineHintsOptions.cs b/src/Features/Core/Portable/InlineHints/InlineHintsOptions.cs index 5d3971c4f31..4c5efefec6d 100644 --- a/src/Features/Core/Portable/InlineHints/InlineHintsOptions.cs +++ b/src/Features/Core/Portable/InlineHints/InlineHintsOptions.cs @@ -39,11 +39,11 @@ internal static class InlineHintsOptions defaultValue: false, storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineParameterNameHints.ForOtherParameters")); - public static readonly PerLanguageOption2 HideForParametersThatDifferBySuffix = + public static readonly PerLanguageOption2 HideForParametersThatDifferOnlyBySuffix = new(nameof(InlineHintsOptions), - nameof(HideForParametersThatDifferBySuffix), + nameof(HideForParametersThatDifferOnlyBySuffix), defaultValue: true, - storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineParameterNameHints.HideForParametersThatDifferBySuffix")); + storageLocations: new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.InlineParameterNameHints.HideForParametersThatDifferOnlyBySuffix")); public static readonly PerLanguageOption2 HideForParametersThatMatchMethodIntent = new(nameof(InlineHintsOptions), diff --git a/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml b/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml index 1f9fff45e8b..1e19503b8b4 100644 --- a/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml +++ b/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml @@ -107,30 +107,6 @@ - - - - - - - - - - - - @@ -210,6 +186,33 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs b/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs index da861067005..a515517a485 100644 --- a/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs +++ b/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs @@ -69,7 +69,8 @@ public AdvancedOptionPageControl(OptionStore optionStore, IComponentModel compon BindToOption(ShowHintsForLiterals, InlineHintsOptions.ForLiteralParameters, LanguageNames.CSharp); BindToOption(ShowHintsForNewExpressions, InlineHintsOptions.ForObjectCreationParameters, LanguageNames.CSharp); BindToOption(ShowHintsForEverythingElse, InlineHintsOptions.ForOtherParameters, LanguageNames.CSharp); - BindToOption(HideHintsWhenClearBasedonMethodAndParameterName, InlineHintsOptions.HideForParametersThatMatchMethodIntent, LanguageNames.CSharp); + BindToOption(HideHintsWhenClearBasedOnMethodAndParameterName, InlineHintsOptions.HideForParametersThatMatchMethodIntent, LanguageNames.CSharp); + BindToOption(HideHintsWhenParameterNamesDifferOnlyBySuffix, InlineHintsOptions.HideForParametersThatDifferOnlyBySuffix, LanguageNames.CSharp); BindToOption(ShowRemarksInQuickInfo, QuickInfoOptions.ShowRemarksInQuickInfo, LanguageNames.CSharp); BindToOption(DisplayLineSeparators, FeatureOnOffOptions.LineSeparator, LanguageNames.CSharp); @@ -117,7 +118,8 @@ private void UpdateInlineHintsOptions() ShowHintsForLiterals.IsEnabled = enabledForParameters; ShowHintsForNewExpressions.IsEnabled = enabledForParameters; ShowHintsForEverythingElse.IsEnabled = enabledForParameters; - HideHintsWhenClearBasedonMethodAndParameterName.IsEnabled = enabledForParameters; + HideHintsWhenClearBasedOnMethodAndParameterName.IsEnabled = enabledForParameters; + HideHintsWhenParameterNamesDifferOnlyBySuffix.IsEnabled = enabledForParameters; } private void DisplayInlineParameterNameHints_Checked(object sender, RoutedEventArgs e) diff --git a/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs b/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs index d29586879b3..753900015de 100644 --- a/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs +++ b/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs @@ -49,6 +49,9 @@ public static string Option_Show_hints_for_everything_else public static string Option_Hide_hints_when_clear_based_on_method_and_parameter_name => ServicesVSResources.Hide_hints_when_clear_based_on_method_and_parameter_name; + public static string Option_Hide_hints_when_parameter_names_differ_only_by_suffix + => ServicesVSResources.Hide_hints_when_parameter_names_differ_only_by_suffix; + public static string Option_RenameTrackingPreview => CSharpVSResources.Show_preview_for_rename_tracking; public static string Option_Split_string_literals_on_enter => CSharpVSResources.Split_string_literals_on_enter; diff --git a/src/VisualStudio/Core/Def/ServicesVSResources.resx b/src/VisualStudio/Core/Def/ServicesVSResources.resx index be2f84b477b..dc13be2a273 100644 --- a/src/VisualStudio/Core/Def/ServicesVSResources.resx +++ b/src/VisualStudio/Core/Def/ServicesVSResources.resx @@ -1569,4 +1569,7 @@ I agree to all of the foregoing: Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + \ No newline at end of file diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf index 5650b4e7f37..96b6d3f4870 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf @@ -247,6 +247,11 @@ Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + Hide hints when parameter names differ only by suffix + + Highlight related components under cursor Zvýrazňovat související komponenty pod kurzorem diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf index dc4ed47437e..c033d826ae0 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf @@ -247,6 +247,11 @@ Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + Hide hints when parameter names differ only by suffix + + Highlight related components under cursor Zugehörige Komponenten unter dem Cursor markieren diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf index 27aa0dcb8fc..c9ec5b9d7d1 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf @@ -247,6 +247,11 @@ Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + Hide hints when parameter names differ only by suffix + + Highlight related components under cursor Resaltar componentes relacionados bajo el cursor diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf index 3c48666730a..40b2686461b 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf @@ -247,6 +247,11 @@ Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + Hide hints when parameter names differ only by suffix + + Highlight related components under cursor Surligner les composants liés sous le curseur diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf index d512596c3f1..5ac2ce1ed50 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf @@ -247,6 +247,11 @@ Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + Hide hints when parameter names differ only by suffix + + Highlight related components under cursor Evidenzia i componenti correlati sotto il cursore diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf index 303d6107e3c..9ed6258d8d1 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf @@ -247,6 +247,11 @@ Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + Hide hints when parameter names differ only by suffix + + Highlight related components under cursor カーソルの下にある関連コンポーネントをハイライトする diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf index 33612a4a344..b3f8ab7c126 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf @@ -247,6 +247,11 @@ Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + Hide hints when parameter names differ only by suffix + + Highlight related components under cursor 커서 아래의 관련 구성 요소 강조 diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf index 0a423bee8bc..42a928871b2 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf @@ -247,6 +247,11 @@ Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + Hide hints when parameter names differ only by suffix + + Highlight related components under cursor Wyróżnij powiązane składniki pod kursorem diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf index c55fed977db..d043c83d1ef 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf @@ -247,6 +247,11 @@ Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + Hide hints when parameter names differ only by suffix + + Highlight related components under cursor Realçar componentes relacionados usando o cursor diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf index 9ebf6635292..9f31971ec71 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf @@ -247,6 +247,11 @@ Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + Hide hints when parameter names differ only by suffix + + Highlight related components under cursor Выделить связанные компоненты под курсором diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf index 2ff1412f350..3b265b5d72e 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf @@ -247,6 +247,11 @@ Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + Hide hints when parameter names differ only by suffix + + Highlight related components under cursor İmlecin altında ilgili bileşenleri vurgula diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf index 261525e8631..4afc2b53356 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf @@ -247,6 +247,11 @@ Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + Hide hints when parameter names differ only by suffix + + Highlight related components under cursor 突出显示光标下的相关组件 diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf index d1b2798838f..86ca81761fb 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf @@ -247,6 +247,11 @@ Hide hints when clear based on method and parameter name + + Hide hints when parameter names differ only by suffix + Hide hints when parameter names differ only by suffix + + Highlight related components under cursor 反白資料指標下的相關元件 diff --git a/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml b/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml index 25605414d99..c599547981d 100644 --- a/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml +++ b/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml @@ -101,30 +101,6 @@ - - - - - - - - - - - - @@ -217,6 +193,32 @@ + + + + + + + + + + + + diff --git a/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml.vb b/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml.vb index 8504a2cc2a7..f4001df4faf 100644 --- a/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml.vb +++ b/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml.vb @@ -63,7 +63,8 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Options BindToOption(ShowHintsForLiterals, InlineHintsOptions.ForLiteralParameters, LanguageNames.VisualBasic) BindToOption(ShowHintsForNewExpressions, InlineHintsOptions.ForObjectCreationParameters, LanguageNames.VisualBasic) BindToOption(ShowHintsForEverythingElse, InlineHintsOptions.ForOtherParameters, LanguageNames.VisualBasic) - BindToOption(HideHintsWhenClearBasedonMethodAndParameterName, InlineHintsOptions.HideForParametersThatMatchMethodIntent, LanguageNames.VisualBasic) + BindToOption(HideHintsWhenClearBasedOnMethodAndParameterName, InlineHintsOptions.HideForParametersThatMatchMethodIntent, LanguageNames.VisualBasic) + BindToOption(HideHintsWhenParameterNamesDifferOnlyBySuffix, InlineHintsOptions.HideForParametersThatDifferOnlyBySuffix, LanguageNames.VisualBasic) BindToOption(EnableEndConstruct, FeatureOnOffOptions.EndConstruct, LanguageNames.VisualBasic) BindToOption(EnableLineCommit, FeatureOnOffOptions.PrettyListing, LanguageNames.VisualBasic) @@ -113,7 +114,8 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Options ShowHintsForLiterals.IsEnabled = enabledForParameters ShowHintsForNewExpressions.IsEnabled = enabledForParameters ShowHintsForEverythingElse.IsEnabled = enabledForParameters - HideHintsWhenClearBasedonMethodAndParameterName.IsEnabled = enabledForParameters + HideHintsWhenClearBasedOnMethodAndParameterName.IsEnabled = enabledForParameters + HideHintsWhenParameterNamesDifferOnlyBySuffix.IsEnabled = enabledForParameters End Sub Private Sub DisplayInlineParameterNameHints_Checked() diff --git a/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageStrings.vb b/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageStrings.vb index 212e22b28b5..63d119d0084 100644 --- a/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageStrings.vb +++ b/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageStrings.vb @@ -51,6 +51,9 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Options Public ReadOnly Property Option_Hide_hints_when_clear_based_on_method_and_parameter_name As String = ServicesVSResources.Hide_hints_when_clear_based_on_method_and_parameter_name + Public ReadOnly Property Option_Hide_hints_when_parameter_names_differ_only_by_suffix As String = + ServicesVSResources.Hide_hints_when_parameter_names_differ_only_by_suffix + Public ReadOnly Property Option_DontPutOutOrRefOnStruct As String Get Return BasicVSResources.Don_t_put_ByRef_on_custom_structure -- GitLab