2 instantiations of CompletionItemRules
Microsoft.CodeAnalysis.Features (2)
Completion\CompletionItemRules.cs (2)
40new( 146return new CompletionItemRules(
181 references to CompletionItemRules
Microsoft.AspNetCore.App.Analyzers (5)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (3)
43private static readonly CompletionItemRules s_rules = CompletionItemRules.Create( 283rules: CompletionItemRules.Default);
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (2)
37private static readonly CompletionItemRules s_rules = CompletionItemRules.Create(
Microsoft.CodeAnalysis.CSharp.Features (51)
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (3)
35private static readonly CompletionItemRules _spaceItemFilterRule = CompletionItemRules.Default.WithFilterCharacterRule( 195rules: CompletionItemRules.Default);
Completion\CompletionProviders\CrefCompletionProvider.cs (3)
351private static CompletionItemRules GetRules(string displayText) 367return CompletionItemRules.Default; 371return CompletionItemRules.Default.WithCommitCharacterRules(commitRules);
Completion\CompletionProviders\DeclarationName\DeclarationNameCompletionProvider.cs (2)
93CSharpFeaturesResources.Name, displayTextSuffix: "", CompletionItemRules.Default); 106CompletionItemRules.Default,
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (4)
31private static readonly CompletionItemRules s_enumTypeRules = 32CompletionItemRules.Default.WithCommitCharacterRules([CharacterSetModificationRule.Create(CharacterSetModificationKind.Replace, '.')]) 206rules: CompletionItemRules.Default, 262rules: CompletionItemRules.Default,
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
102rules: CompletionItemRules.Default));
Completion\CompletionProviders\ExternAliasCompletionProvider.cs (1)
85alias, displayTextSuffix: "", CompletionItemRules.Default, glyph: Glyph.Namespace));
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProvider.cs (1)
116rules: CompletionItemRules.Default,
Completion\CompletionProviders\KeywordCompletionProvider.cs (4)
186private static readonly CompletionItemRules s_tupleRules = CompletionItemRules.Default. 191var rules = context.IsPossibleTupleContext ? s_tupleRules : CompletionItemRules.Default;
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (2)
37private static readonly CompletionItemRules s_rules = CompletionItemRules.Default
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (7)
101private static readonly CompletionItemRules s_arrayRules = 102CompletionItemRules.Create( 107private static readonly CompletionItemRules s_objectRules = 108CompletionItemRules.Create( 113private static readonly CompletionItemRules s_defaultRules = 114CompletionItemRules.Create( 119protected override CompletionItemRules GetCompletionItemRules(ImmutableArray<SymbolAndSelectionInfo> symbols)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (2)
38private static readonly CompletionItemRules s_conversionRules = CompletionItemRules.Default.WithMatchPriority(MatchPriority.Deprioritize);
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Indexers.cs (1)
32rules: CompletionItemRules.Default,
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Operators.cs (2)
73private static readonly CompletionItemRules s_operatorRules; 96s_operatorRules = CompletionItemRules.Default
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (2)
163private static readonly CompletionItemRules s_rules = CompletionItemRules.Create(enterKeyRule: EnterKeyRule.Never);
Completion\CompletionProviders\SnippetCompletionProvider.cs (2)
186var rules = CompletionItemRules.Default.WithFormatOnCommit(service.ShouldFormatSnippet(snippet));
Completion\CompletionProviders\SpeculativeTCompletionProvider.cs (1)
55T, displayTextSuffix: "", CompletionItemRules.Default, glyph: Glyph.TypeParameter));
Completion\CompletionProviders\SymbolCompletionProvider.cs (10)
29private static readonly Dictionary<(bool importDirective, bool preselect, bool tupleLiteral), CompletionItemRules> s_cachedRules = []; 47static CompletionItemRules MakeRule((bool importDirective, bool preselect, bool tupleLiteral) context) 50var generalBaseline = CompletionItemRules.Default. 53var importDirectiveBaseline = CompletionItemRules.Create(commitCharacterRules: 56var rule = context.importDirective ? importDirectiveBaseline : generalBaseline; 216protected override CompletionItemRules GetCompletionItemRules(ImmutableArray<SymbolAndSelectionInfo> symbols, CSharpSyntaxContext context) 219s_cachedRules.TryGetValue(ValueTuple.Create(context.IsLeftSideOfImportAliasDirective, preselect, context.IsPossibleTupleContext), out var rule); 221return rule ?? CompletionItemRules.Default;
Completion\CompletionProviders\TupleNameCompletionProvider.cs (1)
110rules: CompletionItemRules.Default,
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (2)
406private static readonly CompletionItemRules s_defaultRules = 407CompletionItemRules.Create(
Microsoft.CodeAnalysis.EditorFeatures (1)
IntelliSense\AsyncCompletion\CommitManager.cs (1)
79/// based on <see cref="VSCompletionItem"/> item, e.g. based on <see cref="CompletionItemRules"/>.
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
Completion\CompletionServiceTests.cs (1)
114var completionItem = CompletionItem.Create(displayText: nameof(DebugAssertTestCompletionProvider), displayTextSuffix: "", rules: CompletionItemRules.Default);
Completion\GlobalAssemblyCacheCompletionHelperTests.cs (1)
44var helper = new GlobalAssemblyCacheCompletionHelper(CompletionItemRules.Default);
Completion\TestFileSystemCompletionHelper.cs (2)
18internal static readonly CompletionItemRules CompletionRules = CompletionItemRules.Default;
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Interactive\AbstractInteractiveWindowCommandCompletionProvider.cs (1)
49completion, displayTextSuffix: "", CompletionItemRules.Default, description: command.Description.ToSymbolDisplayParts(), glyph: Glyph.Intrinsic));
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (4)
IntelliSense\CSharpCompletionCommandHandlerTests.vb (3)
8221rules:=CompletionItemRules.Default.WithMatchPriority(1000), isComplexTextEdit:=True)) 9601builder.Add(CompletionItem.Create(displayText:=item.displayText, rules:=CompletionItemRules.Default.WithMatchPriority(item.matchPriority))) 10268Dim rules = CompletionItemRules.Default.WithSelectionBehavior(CompletionItemSelectionBehavior.HardSelection).WithMatchPriority(MatchPriority.Preselect)
IntelliSense\CSharpCompletionCommandHandlerTests_DefaultsSource.vb (1)
429Dim rules = CompletionItemRules.Default.WithSelectionBehavior(CompletionItemSelectionBehavior.HardSelection).WithMatchPriority(MatchPriority.Preselect)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (2)
Completion\FSharpCommonCompletionItem.cs (1)
18CompletionItemRules rules,
Completion\FSharpFileSystemCompletionHelper.cs (1)
25CompletionItemRules itemRules)
Microsoft.CodeAnalysis.Features (78)
Completion\CommonCompletionItem.cs (1)
20CompletionItemRules rules,
Completion\CommonCompletionProvider.cs (2)
23private static readonly CompletionItemRules s_suggestionItemRules = CompletionItemRules.Create(enterKeyRule: EnterKeyRule.Never);
Completion\CompletionItem.cs (12)
150public CompletionItemRules Rules { get; } 184CompletionItemRules? rules, 197Rules = rules ?? CompletionItemRules.Default; 221CompletionItemRules? rules) 233CompletionItemRules? rules, 247CompletionItemRules? rules, 263CompletionItemRules? rules = null, 284CompletionItemRules? rules = null, 324CompletionItemRules rules) 351Optional<CompletionItemRules> rules = default, 365var newRules = rules.HasValue ? rules.Value : Rules; 495public CompletionItem WithRules(CompletionItemRules rules)
Completion\CompletionItemRules.cs (23)
39public static CompletionItemRules Default = 96/// Creates a new <see cref="CompletionItemRules"/> instance. 104public static CompletionItemRules Create( 118/// Creates a new <see cref="CompletionItemRules"/> instance. 127public static CompletionItemRules Create( 153/// Creates a new <see cref="CompletionItemRules"/> instance--internal for TypeScript. 161internal static CompletionItemRules Create( 169return CompletionItemRules.Create(filterCharacterRules, commitCharacterRules, enterKeyRule, formatOnCommit, matchPriority); 172private CompletionItemRules With( 206/// Creates a copy of this <see cref="CompletionItemRules"/> with the <see cref="FilterCharacterRules"/> property changed. 208public CompletionItemRules WithFilterCharacterRules(ImmutableArray<CharacterSetModificationRule> filterCharacterRules) 211internal CompletionItemRules WithFilterCharacterRule(CharacterSetModificationRule rule) 214internal CompletionItemRules WithCommitCharacterRule(CharacterSetModificationRule rule) 218/// Creates a copy of this <see cref="CompletionItemRules"/> with the <see cref="CommitCharacterRules"/> property changed. 220public CompletionItemRules WithCommitCharacterRules(ImmutableArray<CharacterSetModificationRule> commitCharacterRules) 224/// Creates a copy of this <see cref="CompletionItemRules"/> with the <see cref="EnterKeyRule"/> property changed. 226public CompletionItemRules WithEnterKeyRule(EnterKeyRule enterKeyRule) 230/// Creates a copy of this <see cref="CompletionItemRules"/> with the <see cref="FormatOnCommit"/> property changed. 232public CompletionItemRules WithFormatOnCommit(bool formatOnCommit) 236/// Creates a copy of this <see cref="CompletionItemRules"/> with the <see cref="MatchPriority"/> property changed. 238public CompletionItemRules WithMatchPriority(int matchPriority) 242/// Creates a copy of this <see cref="CompletionItemRules"/> with the <see cref="SelectionBehavior"/> property changed. 244public CompletionItemRules WithSelectionBehavior(CompletionItemSelectionBehavior selectionBehavior)
Completion\FileSystemCompletionHelper.cs (2)
33private readonly CompletionItemRules _itemRules; 41CompletionItemRules itemRules)
Completion\Providers\AbstractAwaitCompletionProvider.cs (1)
160rules: CompletionItemRules.Default,
Completion\Providers\AbstractDocCommentCompletionProvider.cs (3)
68private readonly CompletionItemRules defaultRules; 70protected AbstractDocCommentCompletionProvider(CompletionItemRules defaultRules) 333private CompletionItemRules GetCompletionItemRules(string displayText)
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
158rules: CompletionItemRules.Default,
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (3)
226private static readonly CompletionItemRules s_defaultRules = 227CompletionItemRules.Create( 232protected static CompletionItemRules GetRules()
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
24protected abstract CompletionItemRules GetCompletionItemRules(ImmutableArray<SymbolAndSelectionInfo> symbols);
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (3)
73var rules = s_rules; 106private static readonly CompletionItemRules s_rules = CompletionItemRules.Create(enterKeyRule: EnterKeyRule.Never);
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (1)
72rules: CompletionItemRules.Default);
Completion\Providers\AbstractPreprocessorCompletionProvider.cs (1)
47CompletionItemRules.Default,
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (2)
26protected abstract CompletionItemRules GetCompletionItemRules(ImmutableArray<SymbolAndSelectionInfo> symbols, TSyntaxContext context); 141var rules = GetCompletionItemRules(symbols, context);
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
241rules: CompletionItemRules.Default
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (1)
79rules: CompletionItemRules.Default,
Completion\Providers\MemberInsertingCompletionItem.cs (1)
23CompletionItemRules rules)
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (1)
163CompletionItemRules completionRules)
Completion\Providers\Scripting\AbstractLoadDirectiveCompletionProvider.cs (2)
16private static readonly CompletionItemRules s_rules = CompletionItemRules.Create(
Completion\Providers\Scripting\AbstractReferenceDirectiveCompletionProvider.cs (2)
17private static readonly CompletionItemRules s_rules = CompletionItemRules.Create(
Completion\Providers\Scripting\GlobalAssemblyCacheCompletionHelper.cs (2)
24private readonly CompletionItemRules _itemRules; 26public GlobalAssemblyCacheCompletionHelper(CompletionItemRules itemRules)
Completion\Providers\Snippets\SnippetCompletionItem.cs (1)
38rules: CompletionItemRules.Default)
Completion\Providers\SymbolCompletionItem.cs (4)
33CompletionItemRules rules, 274CompletionItemRules rules, 306CompletionItemRules rules, 330CompletionItemRules rules,
Completion\Providers\XmlDocCommentCompletionItem.cs (1)
14public static CompletionItem Create(string displayText, string beforeCaretText, string afterCaretText, CompletionItemRules rules)
EmbeddedLanguages\DateAndTime\DateAndTimeEmbeddedCompletionProvider.cs (2)
28private static readonly CompletionItemRules s_rules = 29CompletionItemRules.Default.WithSelectionBehavior(CompletionItemSelectionBehavior.SoftSelection)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (2)
35private static readonly CompletionItemRules s_rules = 36CompletionItemRules.Default.WithSelectionBehavior(CompletionItemSelectionBehavior.SoftSelection)
ExternalAccess\Pythia\Api\PythiaCompletionProviderBase.cs (2)
23CompletionItemRules rules, 37CompletionItemRules rules,
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\Completion\CompletionResultFactory.cs (2)
34public static string[] DefaultCommitCharactersArray { get; } = CreateCommitCharacterArrayFromRules(CompletionItemRules.Default); 402public static string[] CreateCommitCharacterArrayFromRules(CompletionItemRules rules)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (6)
Completion\CompletionFeaturesTests.cs (6)
396mockService.NonDefaultRule = CompletionItemRules.Default.WithCommitCharacterRule(CharacterSetModificationRule.Create(CharacterSetModificationKind.Remove, ' ', '(')); 443mockService.NonDefaultRule = CompletionItemRules.Default.WithCommitCharacterRule(CharacterSetModificationRule.Create(CharacterSetModificationKind.Remove, ' ', '(')); 589public CompletionItemRules NonDefaultRule { get; set; } = CompletionItemRules.Default; 603builder.Add(CodeAnalysis.Completion.CompletionItem.Create($"ItemWithDefaultChar{i}", rules: CompletionItemRules.Default)); 770mockService.NonDefaultRule = CompletionItemRules.Default.WithMatchPriority(MatchPriority.Preselect);
Microsoft.CodeAnalysis.VisualBasic.Features (24)
Completion\CompletionProviders\CompletionListTagCompletionProvider.vb (1)
111rules:=CompletionItemRules.Default.WithMatchPriority(MatchPriority.Preselect),
Completion\CompletionProviders\CrefCompletionProvider.vb (4)
258"Of", displayTextSuffix:="", CompletionItemRules.Default, Glyph.Keyword, 265Private Shared ReadOnly s_defaultRules As CompletionItemRules = CompletionItemRules.Default 267Private Shared Function GetRules(displayText As String) As CompletionItemRules
Completion\CompletionProviders\EnumCompletionProvider.vb (3)
29Private Shared ReadOnly s_enumMemberCompletionItemRules As CompletionItemRules = CompletionItemRules.Default.WithMatchPriority(MatchPriority.Preselect) 134Dim rules = If(preselect, s_enumMemberCompletionItemRules, CompletionItemRules.Default)
Completion\CompletionProviders\KeywordCompletionProvider.vb (3)
183Private Shared ReadOnly s_tupleRules As CompletionItemRules = CompletionItemRules.Default. 187Dim rules = If(context.IsPossibleTupleContext, s_tupleRules, CompletionItemRules.Default)
Completion\CompletionProviders\NamedParameterCompletionProvider.vb (2)
106Private Shared ReadOnly s_itemRules As CompletionItemRules = CompletionItemRules.Default.
Completion\CompletionProviders\ObjectCreationCompletionProvider.vb (3)
59Private Shared ReadOnly s_rules As CompletionItemRules = 60CompletionItemRules.Create( 65Protected Overrides Function GetCompletionItemRules(symbols As ImmutableArray(Of SymbolAndSelectionInfo)) As CompletionItemRules
Completion\CompletionProviders\SymbolCompletionProvider.vb (6)
22Private Shared ReadOnly s_cachedRules As New Dictionary(Of (importDirective As Boolean, preselect As Boolean, tuple As Boolean), CompletionItemRules) 35Private Shared Function MakeRule(context As (importDirective As Boolean, preselect As Boolean, tuple As Boolean)) As CompletionItemRules 37Dim generalBaseline = CompletionItemRules.Default. 41Dim importDirectBasline = CompletionItemRules.Create( 115Protected Overrides Function GetCompletionItemRules(symbols As ImmutableArray(Of SymbolAndSelectionInfo), context As VisualBasicSyntaxContext) As CompletionItemRules 118CompletionItemRules.Default)
Completion\CompletionProviders\XmlDocCommentCompletionProvider.vb (2)
365Private Shared ReadOnly s_defaultRules As CompletionItemRules = 366CompletionItemRules.Create(
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Completion\MockCompletionProvider.vb (1)
16Dim item = CommonCompletionItem.Create("DisplayText", "", rules:=CompletionItemRules.Default)
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
Snippets\SnippetCompletionProvider.vb (2)
77Private Shared ReadOnly s_rules As CompletionItemRules = CompletionItemRules.Create(