Clean up the IntelliSense option pages#71777
Conversation
| Unchecked="Show_items_from_unimported_namespaces_CheckedChanged" | ||
| Indeterminate="Show_items_from_unimported_namespaces_CheckedChanged" | ||
| IsThreeState="True"/> | ||
| Content="{x:Static local:IntelliSenseOptionPageStrings.Option_Show_items_from_unimported_namespaces}" /> |
There was a problem hiding this comment.
Show_items_from_unimported_namespaces, Tab_twice_to_insert_arguments and Show_new_snippet_experience
are using the three state checkbox tricks to indicate they are in experiment.
However, I found
Show_items_from_unimported_namespacesis on by default. I can't find its feature flag.Tab_twice_to_insert_argumentsis off by default now. I also can't find the feature flag. I synced with Sam and he intend to keep it off.Show_new_snippet_experiencehas the feature flag. But it no longer need to use the three state trick because the value could be fetched from the feature flag when it's null.
| InitializeComponent(); | ||
|
|
||
| BindToOption(Automatically_complete_statement_on_semicolon, CompleteStatementOptionsStorage.AutomaticallyCompleteStatementOnSemicolon); | ||
| BindToOption(Show_completion_list_after_a_character_is_typed, CompletionOptionsStorage.TriggerOnTypingLetters, LanguageNames.CSharp); |
|
|
||
| Show_new_snippet_experience.IsChecked = this.OptionStore.GetOption(CompletionOptionsStorage.ShowNewSnippetExperienceUserOption, LanguageNames.CSharp); | ||
| AddSearchHandler(Show_new_snippet_experience); | ||
| BindToOption(Tab_twice_to_insert_arguments, CompletionViewOptionsStorage.EnableArgumentCompletionSnippets, LanguageNames.CSharp, onNullValue: () => false); |
There was a problem hiding this comment.
There is no feature flag for this option. So now it's off by default. And I have synced with Sam he is OK to leave this off
| Show_completion_list_after_a_character_is_deleted_Unchecked(sender, e); | ||
| } | ||
|
|
||
| private void Show_completion_list_after_a_character_is_deleted_Checked(object sender, RoutedEventArgs e) |
There was a problem hiding this comment.
Show_completion_list_after_a_character_is_deleted_Checked and Show_completion_list_after_a_character_is_deleted_Unchecked could be removed because on line 22
BindToOption(Show_completion_list_after_a_character_is_deleted, CompletionOptionsStorage.TriggerOnDeletion, LanguageNames.CSharp, onNullValue: () => false);
| private void Show_completion_list_after_a_character_is_deleted_Unchecked(object sender, RoutedEventArgs e) | ||
| => this.OptionStore.SetOption(CompletionOptionsStorage.TriggerOnDeletion, LanguageNames.CSharp, value: false); | ||
|
|
||
| private void Show_items_from_unimported_namespaces_CheckedChanged(object sender, RoutedEventArgs e) |
There was a problem hiding this comment.
On line 41, BindToOption(Show_items_from_unimported_namespaces, CompletionOptionsStorage.ShowItemsFromUnimportedNamespaces, LanguageNames.CSharp, onNullValue: static () => true);, so we don't need the three state trick
| this.OptionStore.SetOption(CompletionOptionsStorage.ShowItemsFromUnimportedNamespaces, LanguageNames.CSharp, value: Show_items_from_unimported_namespaces.IsChecked); | ||
| } | ||
|
|
||
| private void Tab_twice_to_insert_arguments_CheckedChanged(object sender, RoutedEventArgs e) |
There was a problem hiding this comment.
On line 43 BindToOption(Tab_twice_to_insert_arguments, CompletionViewOptionsStorage.EnableArgumentCompletionSnippets, LanguageNames.CSharp, onNullValue: static () => false); , so these methods could be removed
| BindToOption(Show_completion_list_after_a_character_is_typed, CompletionOptionsStorage.TriggerOnTypingLetters, LanguageNames.VisualBasic) | ||
| Show_completion_list_after_a_character_is_deleted.IsChecked = Me.OptionStore.GetOption( | ||
| CompletionOptionsStorage.TriggerOnDeletion, LanguageNames.VisualBasic) <> False | ||
| BindToOption(Show_completion_list_after_a_character_is_deleted, CompletionOptionsStorage.TriggerOnDeletion, LanguageNames.VisualBasic, function() True) |
There was a problem hiding this comment.
Note: VB's behavior is not aligned with C# here.
In C# the original code is Show_completion_list_after_a_character_is_deleted.IsChecked = this.OptionStore.GetOption(CompletionOptionsStorage.TriggerOnDeletion, LanguageNames.CSharp) == true;, which means the checkbox is false when option value is null.
But in VB (see the old code), the checkbox is true, when option value is null.
I just keep this behavior.
There was a problem hiding this comment.
Also, VB's behavior is different from C# here.
When CompletionOptionsStorage.TriggerOnTypingLetters is off, in VB, we don't set CompletionOptionsStorage.TriggerOnDeletion to off. But in C# we do.
Not sure what's the original user story. I just keep this

I am going to move the IntelliSense page to VS new Unified Settings.
Our old page would still be used because the new Unified Settings is in preview.
Before that happens, I would like to clean up our Intellisense page because it's in a strange stage now.
See my comments for detailed changes.