-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Clean up the IntelliSense option pages #71777
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
Changes from all commits
9f283f4
d7923be
c7bc566
45ad7ce
418e434
94383e8
548be16
ea5b165
25acf2d
1495500
fefb5ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,6 @@ | |
| using Microsoft.CodeAnalysis; | ||
| using Microsoft.CodeAnalysis.Completion; | ||
| using Microsoft.CodeAnalysis.Editor.CSharp.CompleteStatement; | ||
| using Microsoft.CodeAnalysis.Editor.Shared.Options; | ||
| using Microsoft.VisualStudio.LanguageServices.Implementation.Options; | ||
|
|
||
| namespace Microsoft.VisualStudio.LanguageServices.CSharp.Options | ||
|
|
@@ -19,15 +18,15 @@ public IntelliSenseOptionPageControl(OptionStore optionStore) : base(optionStore | |
| { | ||
| InitializeComponent(); | ||
|
|
||
| BindToOption(Automatically_complete_statement_on_semicolon, CompleteStatementOptionsStorage.AutomaticallyCompleteStatementOnSemicolon); | ||
| BindToOption(Show_completion_list_after_a_character_is_typed, CompletionOptionsStorage.TriggerOnTypingLetters, LanguageNames.CSharp); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| BindToOption(Show_completion_list_after_a_character_is_deleted, CompletionOptionsStorage.TriggerOnDeletion, LanguageNames.CSharp, onNullValue: static () => false); | ||
| Show_completion_list_after_a_character_is_deleted.IsEnabled = Show_completion_list_after_a_character_is_typed.IsChecked == true; | ||
|
|
||
| BindToOption(Show_completion_item_filters, CompletionViewOptionsStorage.ShowCompletionItemFilters, LanguageNames.CSharp); | ||
| BindToOption(Automatically_show_completion_list_in_argument_lists, CompletionOptionsStorage.TriggerInArgumentLists, LanguageNames.CSharp); | ||
| BindToOption(Highlight_matching_portions_of_completion_list_items, CompletionViewOptionsStorage.HighlightMatchingPortionsOfCompletionListItems, LanguageNames.CSharp); | ||
| BindToOption(Show_completion_item_filters, CompletionViewOptionsStorage.ShowCompletionItemFilters, LanguageNames.CSharp); | ||
|
|
||
| BindToOption(Show_completion_list_after_a_character_is_typed, CompletionOptionsStorage.TriggerOnTypingLetters, LanguageNames.CSharp); | ||
| Show_completion_list_after_a_character_is_deleted.IsChecked = this.OptionStore.GetOption(CompletionOptionsStorage.TriggerOnDeletion, LanguageNames.CSharp) == true; | ||
| Show_completion_list_after_a_character_is_deleted.IsEnabled = Show_completion_list_after_a_character_is_typed.IsChecked == true; | ||
| AddSearchHandler(Show_completion_list_after_a_character_is_deleted); | ||
| BindToOption(Automatically_complete_statement_on_semicolon, CompleteStatementOptionsStorage.AutomaticallyCompleteStatementOnSemicolon); | ||
|
|
||
| BindToOption(Never_include_snippets, CompletionOptionsStorage.SnippetsBehavior, SnippetsRule.NeverInclude, LanguageNames.CSharp); | ||
| BindToOption(Always_include_snippets, CompletionOptionsStorage.SnippetsBehavior, SnippetsRule.AlwaysInclude, LanguageNames.CSharp); | ||
|
|
@@ -38,16 +37,12 @@ public IntelliSenseOptionPageControl(OptionStore optionStore) : base(optionStore | |
| BindToOption(Always_add_new_line_on_enter, CompletionOptionsStorage.EnterKeyBehavior, EnterKeyRule.Always, LanguageNames.CSharp); | ||
|
|
||
| BindToOption(Show_name_suggestions, CompletionOptionsStorage.ShowNameSuggestions, LanguageNames.CSharp); | ||
| BindToOption(Automatically_show_completion_list_in_argument_lists, CompletionOptionsStorage.TriggerInArgumentLists, LanguageNames.CSharp); | ||
|
|
||
| Show_items_from_unimported_namespaces.IsChecked = this.OptionStore.GetOption(CompletionOptionsStorage.ShowItemsFromUnimportedNamespaces, LanguageNames.CSharp); | ||
| AddSearchHandler(Show_items_from_unimported_namespaces); | ||
|
|
||
| Tab_twice_to_insert_arguments.IsChecked = this.OptionStore.GetOption(CompletionViewOptionsStorage.EnableArgumentCompletionSnippets, LanguageNames.CSharp); | ||
| AddSearchHandler(Tab_twice_to_insert_arguments); | ||
| BindToOption(Show_items_from_unimported_namespaces, CompletionOptionsStorage.ShowItemsFromUnimportedNamespaces, LanguageNames.CSharp, onNullValue: static () => true); | ||
|
|
||
| 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: static () => false); | ||
| BindToOption(Show_new_snippet_experience, CompletionOptionsStorage.ShowNewSnippetExperienceUserOption, LanguageNames.CSharp, | ||
| onNullValue: () => this.OptionStore.GetOption(CompletionOptionsStorage.ShowNewSnippetExperienceFeatureFlag)); | ||
| } | ||
|
|
||
| private void Show_completion_list_after_a_character_is_typed_Checked(object sender, RoutedEventArgs e) | ||
|
|
@@ -57,31 +52,6 @@ private void Show_completion_list_after_a_character_is_typed_Unchecked(object se | |
| { | ||
| Show_completion_list_after_a_character_is_deleted.IsEnabled = Show_completion_list_after_a_character_is_typed.IsChecked == true; | ||
| Show_completion_list_after_a_character_is_deleted.IsChecked = false; | ||
| 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) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| => this.OptionStore.SetOption(CompletionOptionsStorage.TriggerOnDeletion, LanguageNames.CSharp, value: true); | ||
|
|
||
| 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) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On line 41, |
||
| { | ||
| Show_items_from_unimported_namespaces.IsThreeState = false; | ||
| 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) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On line 43 |
||
| { | ||
| Tab_twice_to_insert_arguments.IsThreeState = false; | ||
| this.OptionStore.SetOption(CompletionViewOptionsStorage.EnableArgumentCompletionSnippets, LanguageNames.CSharp, value: Tab_twice_to_insert_arguments.IsChecked); | ||
| } | ||
|
|
||
| private void Show_new_snippet_experience_CheckedChanged(object sender, RoutedEventArgs e) | ||
| { | ||
| Show_new_snippet_experience.IsThreeState = false; | ||
| this.OptionStore.SetOption(CompletionOptionsStorage.ShowNewSnippetExperienceUserOption, LanguageNames.CSharp, value: Show_new_snippet_experience.IsChecked); | ||
| } | ||
| } | ||
| } | ||

Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Show_items_from_unimported_namespaces,Tab_twice_to_insert_argumentsandShow_new_snippet_experienceare 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.