2 instantiations of CompletionItem
Microsoft.CodeAnalysis.Features (2)
Completion\CompletionItem.cs (2)
290
return new
CompletionItem
(
386
return new
CompletionItem
(
566 references to CompletionItem
Microsoft.AspNetCore.App.Analyzers (7)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (4)
66
public override Task<CompletionDescription?> GetDescriptionAsync(Document document,
CompletionItem
item, CancellationToken cancellationToken)
77
public override Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey, CancellationToken cancellationToken)
271
context.AddItem(
CompletionItem
.Create(
280
context.SuggestionModeItem =
CompletionItem
.Create(
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (3)
60
public override Task<CompletionDescription?> GetDescriptionAsync(Document document,
CompletionItem
item, CancellationToken cancellationToken)
71
public override Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey, CancellationToken cancellationToken)
150
context.AddItem(
CompletionItem
.Create(
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\FrameworkParametersCompletionProviderTests.cs (1)
845
var
item = result.Completions.ItemsList.FirstOrDefault(i => i.DisplayText == "id");
Microsoft.AspNetCore.App.CodeFixes (1)
Dependencies\ExtensionMethodsCompletionProvider.cs (1)
76
context.AddItem(
CompletionItem
.Create(
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (11)
Completion\CompletionProviders\ConversionCompletionProviderTests.cs (8)
13
using CompletionItem = Microsoft.CodeAnalysis.Completion.
CompletionItem
;
29
var
castCompletionItem = (await GetCompletionItemsAsync("""
46
CompletionItem
.Create("SomeText0"),
48
CompletionItem
.Create("SomeText1"),
49
CompletionItem
.Create("\uffdcStartWith_FFDC_Identifier"), // http://www.fileformat.info/info/unicode/char/ffdc/index.htm
50
CompletionItem
.Create("SomeText2"),
51
CompletionItem
.Create("\uD884\uDF4AStartWith_3134A_Identifier"), // http://www.fileformat.info/info/unicode/char/3134a/index.htm
52
CompletionItem
.Create("SomeText3"),
Completion\CompletionProviders\TypeImportCompletionProviderTests.cs (1)
1419
private static void AssertRelativeOrder(List<string> expectedTypesInRelativeOrder, ImmutableArray<
CompletionItem
> allCompletionItems)
Completion\CompletionServiceTests.cs (2)
59
var
item =
CompletionItem
.Create("ThirdPartyCompletionProviderItem");
Microsoft.CodeAnalysis.CSharp.Features (58)
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (5)
153
private static ImmutableArray<
CompletionItem
> GetNameEqualsItems(
176
private static IEnumerable<
CompletionItem
> GetNameColonItems(
198
internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
246
protected override Task<TextChange?> GetTextChangeAsync(
CompletionItem
selectedItem, char? ch, CancellationToken cancellationToken)
249
private static TextChange? GetTextChange(
CompletionItem
selectedItem, char? ch)
Completion\CompletionProviders\CrefCompletionProvider.cs (5)
236
private static IEnumerable<
CompletionItem
> CreateCompletionItems(
260
ImmutableArray<KeyValuePair<string, string>> options, [NotNullWhen(true)] out
CompletionItem
? item)
275
private static
CompletionItem
CreateItem(
328
private static
CompletionItem
CreateItemFromBuilder(
375
protected override Task<TextChange?> GetTextChangeAsync(
CompletionItem
selectedItem, char? ch, CancellationToken cancellationToken)
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
31
protected override async Task<
CompletionItem
?> GetSuggestionModeItemAsync(
Completion\CompletionProviders\DeclarationName\DeclarationNameCompletionProvider.cs (1)
101
private static
CompletionItem
CreateCompletionItem(string name, Glyph glyph, string sortText)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
316
internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (3)
39
CompletionItem
completionItem,
69
protected override SyntaxToken GetToken(
CompletionItem
completionItem, SyntaxTree tree, CancellationToken cancellationToken)
128
internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (2)
61
public override async Task<ImmutableArray<
CompletionItem
>> GetItemsAsync()
161
CompletionItem
CreateCompletionItem(ISymbol member)
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (1)
144
protected override
CompletionItem
CreateItem(
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProvider.cs (9)
74
var completionItems = new HashSet<
CompletionItem
>(CompletionItemComparer.Instance);
81
completionItems.Add(
CompletionItem
.Create(callingConvention, tags: GlyphTags.GetTags(Glyph.Keyword)));
92
private static void AddTypes(HashSet<
CompletionItem
> completionItems, int contextPosition, SemanticModel semanticModel, CancellationToken cancellationToken)
122
internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
125
private sealed class CompletionItemComparer : IEqualityComparer<
CompletionItem
>
127
public static readonly IEqualityComparer<
CompletionItem
> Instance = new CompletionItemComparer();
129
public bool Equals(
CompletionItem
? x,
CompletionItem
? y)
134
public int GetHashCode(
CompletionItem
obj)
Completion\CompletionProviders\ImportCompletion\ExtensionMethodImportCompletionProvider.cs (1)
53
CompletionItem
item,
Completion\CompletionProviders\ImportCompletion\TypeImportCompletionProvider.cs (1)
53
CompletionItem
item,
Completion\CompletionProviders\KeywordCompletionProvider.cs (1)
189
protected override
CompletionItem
CreateItem(RecommendedKeyword keyword, CSharpSyntaxContext context, CancellationToken cancellationToken)
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (2)
132
internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
280
protected override Task<TextChange?> GetTextChangeAsync(
CompletionItem
selectedItem, char? ch, CancellationToken cancellationToken)
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (1)
136
protected override string GetInsertionText(
CompletionItem
item, char ch)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (4)
144
CompletionItem
item,
160
CompletionItem
item,
175
private static Task<CompletionChange> ReplaceTextAfterOperatorAsync(Document document,
CompletionItem
item, string text, CancellationToken cancellationToken)
180
CompletionItem
item,
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (3)
77
Document document,
CompletionItem
item, CancellationToken cancellationToken)
132
private static async Task<CompletionDescription?> GetConversionDescriptionAsync(Document document,
CompletionItem
item, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
142
private static async Task<ISymbol?> TryRehydrateAsync(Document document,
CompletionItem
item, CancellationToken cancellationToken)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Indexers.cs (2)
39
private static Task<CompletionChange> GetIndexerChangeAsync(Document document,
CompletionItem
item, CancellationToken cancellationToken)
42
private static Task<CompletionDescription> GetIndexerDescriptionAsync(Document document,
CompletionItem
item, SymbolDescriptionOptions options, CancellationToken cancellationToken)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Operators.cs (2)
124
Document document,
CompletionItem
item, CancellationToken cancellationToken)
160
private static Task<CompletionDescription> GetOperatorDescriptionAsync(Document document,
CompletionItem
item, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\CompletionProviders\OverrideCompletionProvider.cs (1)
44
protected override SyntaxToken GetToken(
CompletionItem
completionItem, SyntaxTree tree, CancellationToken cancellationToken)
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (1)
70
protected override SyntaxToken GetToken(
CompletionItem
completionItem, SyntaxTree tree, CancellationToken cancellationToken)
Completion\CompletionProviders\PartialTypeCompletionProvider.cs (1)
82
Document document,
CompletionItem
selectedItem, char? ch, CancellationToken cancellationToken)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
160
internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\CompletionProviders\SnippetCompletionProvider.cs (2)
101
private static async Task<ImmutableArray<
CompletionItem
>> GetSnippetsForDocumentAsync(
166
private static ImmutableArray<
CompletionItem
> GetSnippetCompletionItems(
Completion\CompletionProviders\SymbolCompletionProvider.cs (2)
220
protected override
CompletionItem
CreateItem(
268
protected override string GetInsertionText(
CompletionItem
item, char ch)
Completion\CompletionProviders\TupleNameCompletionProvider.cs (1)
116
protected override Task<TextChange?> GetTextChangeAsync(
CompletionItem
selectedItem, char? ch, CancellationToken cancellationToken)
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (3)
68
protected override async Task<IEnumerable<
CompletionItem
>?> GetItemsWorkerAsync(
140
var items = new List<
CompletionItem
>();
194
private void AddXmlElementItems(List<
CompletionItem
> items, XmlElementStartTagSyntax startTag)
SpellCheck\CSharpSpellcheckCodeFixProvider.cs (1)
65
protected override bool IsGeneric(
CompletionItem
completionItem)
Microsoft.CodeAnalysis.EditorFeatures (49)
Extensibility\Completion\ICustomCommitCompletionProvider.cs (1)
17
void Commit(
CompletionItem
completionItem, Document document, ITextView textView, ITextBuffer subjectBuffer, ITextSnapshot triggerSnapshot, char? commitChar);
IntelliSense\AsyncCompletion\CommitManager.cs (6)
28
using RoslynCompletionItem = Microsoft.CodeAnalysis.Completion.
CompletionItem
;
121
var
roslynItem = itemData.RoslynItem;
134
if (session.Properties.TryGetProperty(CompletionSource.ExcludedCommitCharactersMap, out MultiDictionary<char,
RoslynCompletionItem
> excludedCommitCharactersMap))
189
RoslynCompletionItem
roslynItem,
352
internal static bool IsCommitCharacter(CompletionRules completionRules,
CompletionItem
item, char ch)
384
internal static bool SendEnterThroughToEditor(CompletionRules rules,
RoslynCompletionItem
item, string textTypedSoFar)
IntelliSense\AsyncCompletion\CompletionItemData.cs (7)
7
using RoslynCompletionItem = Microsoft.CodeAnalysis.Completion.
CompletionItem
;
11
internal sealed record class CompletionItemData(
RoslynCompletionItem
RoslynItem, SnapshotPoint? TriggerLocation)
18
public static
RoslynCompletionItem
GetOrAddDummyRoslynItem(CompletionItem vsItem)
24
var
roslynItem = CreateDummyRoslynItem(vsItem);
30
public static void AddData(CompletionItem vsCompletionItem,
RoslynCompletionItem
roslynItem, SnapshotPoint? triggerLocation)
33
private static
RoslynCompletionItem
CreateDummyRoslynItem(CompletionItem vsItem)
34
=>
RoslynCompletionItem
.Create(
IntelliSense\AsyncCompletion\CompletionSource.cs (8)
31
using RoslynCompletionItem = Microsoft.CodeAnalysis.Completion.
CompletionItem
;
53
private static readonly ConditionalWeakTable<
RoslynCompletionItem
, StrongBox<VSCompletionItemData>> s_roslynItemToVsItemData = new();
427
if (session.Properties.TryGetProperty(ExcludedCommitCharactersMap, out MultiDictionary<char,
RoslynCompletionItem
> excludedCommitCharactersMap))
510
RoslynCompletionItem
roslynItem,
575
private static MultiDictionary<char,
RoslynCompletionItem
> GetExcludedCommitCharacters(IReadOnlyList<
RoslynCompletionItem
> roslynItems)
577
var map = new MultiDictionary<char,
RoslynCompletionItem
>();
578
foreach (
var
roslynItem in roslynItems)
IntelliSense\AsyncCompletion\FilterSet.cs (3)
17
using RoslynCompletionItem = Microsoft.CodeAnalysis.Completion.
CompletionItem
;
132
public (ImmutableArray<CompletionFilter> filters, int data) GetFiltersAndAddToSet(
RoslynCompletionItem
item)
157
internal static List<CompletionFilter> GetFilters(
RoslynCompletionItem
item)
IntelliSense\AsyncCompletion\Helpers.cs (8)
13
using RoslynCompletionItem = Microsoft.CodeAnalysis.Completion.
CompletionItem
;
26
public static
RoslynCompletionItem
PromoteItem(
RoslynCompletionItem
item, int index)
32
public static
RoslynCompletionItem
DemoteItem(
RoslynCompletionItem
item)
44
public static bool TryGetOriginalIndexOfPromotedItem(
RoslynCompletionItem
item, out int originalIndex)
116
public static bool IsFilterCharacter(
RoslynCompletionItem
item, char ch, string textTypedSoFar)
159
public static bool TextTypedSoFarMatchesItem(
RoslynCompletionItem
item, string textTypedSoFar)
IntelliSense\AsyncCompletion\ItemManager.CompletionListUpdater.cs (10)
25
using RoslynCompletionItem = Microsoft.CodeAnalysis.Completion.
CompletionItem
;
312
var
completionItem = includedDefault.CompletionItem;
452
var
item = matchResult.CompletionItem;
562
var
xItem = x.CompletionItem;
563
var
yItem = y.CompletionItem;
575
static int GetPriority(
RoslynCompletionItem
item)
623
static Span GetOffsetSpan(TextSpan span,
RoslynCompletionItem
item)
757
private bool IsHardSelection(
RoslynCompletionItem
item, bool matchedFilterText)
840
var
selectedItem = items[itemSelection.SelectedItemIndex].CompletionItem;
901
var
item = matches[i].CompletionItem;
IntelliSense\AsyncCompletion\ItemManager.cs (4)
18
using RoslynCompletionItem = Microsoft.CodeAnalysis.Completion.
CompletionItem
;
189
var
xRoslyn = x is not null ? CompletionItemData.GetOrAddDummyRoslynItem(x) : null;
190
var
yRoslyn = y is not null ? CompletionItemData.GetOrAddDummyRoslynItem(y) : null;
193
return Comparer<
RoslynCompletionItem
>.Default.Compare(xRoslyn, yRoslyn);
IntelliSense\AsyncCompletion\RecentItemsManager.cs (2)
31
public void MakeMostRecentItem(
CompletionItem
item)
48
public int GetRecentItemIndex(
CompletionItem
item)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (11)
Completion\AbstractCompletionProviderTests.cs (11)
244
bool Predicate(RoslynCompletion.
CompletionItem
c)
302
private static bool FiltersMatch(List<CompletionFilter> expectedMatchingFilters, RoslynCompletion.
CompletionItem
item)
617
var
firstItem = items.First(i => CompareItems(i.DisplayText, itemToCommit));
632
RoslynCompletion.
CompletionItem
completionItem,
673
RoslynCompletion.
CompletionItem
completionItem,
740
var
firstItem = items.First(i => CompareItems(i.DisplayText + i.DisplayTextSuffix, itemToCommit));
973
var
item = completionList.ItemsList.First(c => CompareItems(c.DisplayText, expectedItem));
1022
var
item = completionList.ItemsList.FirstOrDefault(i => i.DisplayText == expectedItem);
1052
var
item = completionList.ItemsList.Single(c => c.DisplayText == expectedItem);
1328
var
item = completionList.ItemsList.First(i => i.DisplayText.StartsWith(textTypedSoFar));
1343
protected async Task<IReadOnlyList<RoslynCompletion.
CompletionItem
>> GetCompletionItemsAsync(
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities2 (4)
Intellisense\TestState.vb (4)
397
Public Async Function AssertCompletionItemsContain(predicate As Func(Of
CompletionItem
, Boolean)) As Task
523
Public Function GetSelectedItem() As
CompletionItem
537
Public Function GetCompletionItems() As IList(Of
CompletionItem
)
543
Private Shared Function GetRoslynCompletionItem(item As Data.CompletionItem) As
CompletionItem
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
Completion\CompletionServiceTests.cs (4)
114
var
completionItem =
CompletionItem
.Create(displayText: nameof(DebugAssertTestCompletionProvider), displayTextSuffix: "", rules: CompletionItemRules.Default);
119
public override Task<CompletionDescription> GetDescriptionAsync(Document document,
CompletionItem
item, CancellationToken cancellationToken)
124
public override Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey, CancellationToken cancellationToken)
Completion\FileSystemCompletionHelperTests.cs (1)
17
private static void AssertItemsEqual(ImmutableArray<
CompletionItem
> actual, params string[] expected)
Completion\GlobalAssemblyCacheCompletionHelperTests.cs (1)
42
private static IEnumerable<
CompletionItem
> GetItems(string pathSoFar)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (35)
IntelliSense\CompletionRulesTests.vb (2)
66
Dim item =
CompletionItem
.Create(word)
84
Dim item =
CompletionItem
.Create(word)
IntelliSense\CompletionServiceTests.vb (4)
82
context.AddItem(
CompletionItem
.Create("Completion Item From Test Completion Provider"))
120
Public Shared Item As
CompletionItem
=
CompletionItem
.Create("MyRoleItem")
137
Public Overrides Function GetDescriptionAsync(document As Document, item As
CompletionItem
, cancellationToken As Threading.CancellationToken) As Task(Of CompletionDescription)
IntelliSense\CompletionServiceTests_Exclusivitiy.vb (1)
91
context.AddItem(
CompletionItem
.Create(String.Format(s_itemText, s_index)))
IntelliSense\CSharpCompletionCommandHandlerTests.vb (20)
8219
context.AddItem(
CompletionItem
.Create(
8229
Public Overrides Function GetChangeAsync(document As Document, item As
CompletionItem
, commitKey As Char?, cancellationToken As CancellationToken) As Task(Of CompletionChange)
8258
Dim intelliCodeItem =
CompletionItem
.Create(displayText:="★ Length", filterText:="Length")
8262
context.AddItem(
CompletionItem
.Create(displayText:="★ Normalize", filterText:="Normalize", displayTextSuffix:="()"))
8263
context.AddItem(
CompletionItem
.Create(displayText:="Normalize", filterText:="Normalize"))
8264
context.AddItem(
CompletionItem
.Create(displayText:="Length", filterText:="Length"))
8265
context.AddItem(
CompletionItem
.Create(displayText:="ToString", filterText:="ToString", displayTextSuffix:="()"))
8266
context.AddItem(
CompletionItem
.Create(displayText:="First", filterText:="First", displayTextSuffix:="()"))
8274
Public Overrides Function GetChangeAsync(document As Document, item As
CompletionItem
, commitKey As Char?, cancellationToken As CancellationToken) As Task(Of CompletionChange)
9591
Public Property Items As ImmutableArray(Of
CompletionItem
)
9599
Dim builder = ArrayBuilder(Of
CompletionItem
).GetInstance(items.Length)
9601
builder.Add(
CompletionItem
.Create(displayText:=item.displayText, rules:=CompletionItemRules.Default.WithMatchPriority(item.matchPriority)))
9686
context.AddItem(
CompletionItem
.Create(displayText:="★ Length2", filterText:="Length"))
10269
context.AddItem(
CompletionItem
.Create(displayText:="★ length", filterText:="length", rules:=rules))
10342
context.AddItem(
CompletionItem
.Create(displayText:=DisplayText, filterText:=DisplayText))
10351
Public Function NotifyCommittingItemAsync(document As Document, item As
CompletionItem
, commitKey As Char?, cancellationToken As CancellationToken) As Task Implements INotifyCommittingItemCompletionProvider.NotifyCommittingItemAsync
10769
context.AddItem(
CompletionItem
.Create(displayText:="Consolation"))
10770
context.AddItem(
CompletionItem
.Create(displayText:="Add code that write to console", filterText:="cw").WithAdditionalFilterTexts(ImmutableArray.Create("Console", "Write")))
10771
context.AddItem(
CompletionItem
.Create(displayText:="Add code that write line to console", filterText:="cwl").WithAdditionalFilterTexts(ImmutableArray.Create("Console", "WriteLine")))
10779
Public Overrides Function GetChangeAsync(document As Document, item As
CompletionItem
, commitKey As Char?, cancellationToken As CancellationToken) As Task(Of CompletionChange)
IntelliSense\CSharpCompletionCommandHandlerTests_DefaultsSource.vb (6)
430
context.AddItem(
CompletionItem
.Create(displayText:="★ FirstStarred", filterText:="FirstStarred", sortText:=GetSortText(1), rules:=rules))
431
context.AddItem(
CompletionItem
.Create(displayText:="★ SecondStarred", filterText:="SecondStarred", sortText:=GetSortText(2), rules:=rules))
673
Dim builder = ArrayBuilder(Of
CompletionItem
).GetInstance(RegularCount + ExpandedCount)
697
Private Async Function CreateExpandedItems(builder As ArrayBuilder(Of
CompletionItem
), count As Integer) As Task
713
Private Shared Sub CreateRegularItems(builder As ArrayBuilder(Of
CompletionItem
), count As Integer)
715
builder.Add(
CompletionItem
.Create($"ItemRegular{i}"))
IntelliSense\MockCompletionProvider.vb (2)
17
Private ReadOnly _getItems As Func(Of Document, Integer, CancellationToken, IEnumerable(Of
CompletionItem
))
21
Public Sub New(Optional getItems As Func(Of Document, Integer, CancellationToken, IEnumerable(Of
CompletionItem
)) = Nothing,
Microsoft.CodeAnalysis.ExternalAccess.FSharp (5)
Completion\FSharpCommonCompletionItem.cs (1)
15
public static
CompletionItem
Create(
Completion\FSharpFileSystemCompletionHelper.cs (1)
37
public Task<ImmutableArray<
CompletionItem
>> GetItemsAsync(string directoryPath, CancellationToken cancellationToken)
Completion\IFSharpCommonCompletionProvider.cs (2)
22
Func<
CompletionItem
, char?, CancellationToken, Task<TextChange?>> baseGetTextChangeAsync,
23
CompletionItem
selectedItem,
Internal\Completion\FSharpInternalCommonCompletionProvider.cs (1)
31
protected override Task<TextChange?> GetTextChangeAsync(
CompletionItem
selectedItem, char? ch, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
Completion\OmniSharpCompletionService.cs (2)
43
CompletionItem
item,
50
public static string? GetProviderName(this
CompletionItem
completionItem) => completionItem.ProviderName;
Microsoft.CodeAnalysis.Features (308)
Completion\CommonCompletionItem.cs (4)
17
public static
CompletionItem
Create(
50
return
CompletionItem
.CreateInternal(
63
public static bool HasDescription(
CompletionItem
item)
66
public static CompletionDescription GetDescription(
CompletionItem
item)
Completion\CommonCompletionProvider.cs (8)
56
public sealed override Task<CompletionDescription?> GetDescriptionAsync(Document document,
CompletionItem
item, CancellationToken cancellationToken)
64
internal override async Task<CompletionDescription?> GetDescriptionAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
76
Document document,
CompletionItem
item,
103
Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
110
public override async Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey = null, CancellationToken cancellationToken = default)
117
public virtual Task<TextChange?> GetTextChangeAsync(Document document,
CompletionItem
selectedItem, char? ch, CancellationToken cancellationToken)
120
protected virtual Task<TextChange?> GetTextChangeAsync(
CompletionItem
selectedItem, char? ch, CancellationToken cancellationToken)
123
protected static
CompletionItem
CreateSuggestionModeItem(string? displayText, string? description)
Completion\CommonCompletionService.cs (5)
19
protected override
CompletionItem
GetBetterItem(
CompletionItem
item,
CompletionItem
existingItem)
37
protected static bool IsKeywordItem(
CompletionItem
item)
40
protected static bool IsSnippetItem(
CompletionItem
item)
Completion\CompletionChange.cs (3)
13
/// The change to be applied to the document when a <see cref="
CompletionItem
"/> is committed.
37
/// True if the changes include the typed character that caused the <see cref="
CompletionItem
"/>
70
/// cref="
CompletionItem
"/> to be committed. If false, the completion host will determine if and where the
Completion\CompletionContext.cs (13)
23
private readonly SegmentedList<
CompletionItem
> _items = [];
25
private
CompletionItem
? _suggestionModeItem;
49
/// This is the most common value used for <see cref="
CompletionItem
.Span"/> and will
50
/// be automatically assigned to any <see cref="
CompletionItem
"/> that has no <see cref="
CompletionItem
.Span"/> specified.
163
internal IReadOnlyList<
CompletionItem
> Items => _items;
165
public void AddItem(
CompletionItem
item)
176
public void AddItems(IEnumerable<
CompletionItem
> items)
183
foreach (
var
item in items)
190
/// An optional <see cref="
CompletionItem
"/> that appears selected in the list presented to the user during suggestion mode.
199
public
CompletionItem
? SuggestionModeItem
225
private
CompletionItem
FixItem(
CompletionItem
item)
Completion\CompletionDescription.cs (1)
12
/// The description of a <see cref="
CompletionItem
"/>.
Completion\CompletionHelper.cs (13)
70
static bool IsKeywordItem(
CompletionItem
item)
73
static bool TagsEqual(
CompletionItem
item1,
CompletionItem
item2)
80
CompletionItem
item1,
81
CompletionItem
item2,
190
private static int CompareSpecialMatchPriorityValues(
CompletionItem
item1,
CompletionItem
item2)
204
private static int ComparePreselection(
CompletionItem
item1,
CompletionItem
item2)
210
private static int CompareDeprioritization(
CompletionItem
item1,
CompletionItem
item2)
213
private static int CompareExpandedItem(
CompletionItem
item1, PatternMatch match1,
CompletionItem
item2, PatternMatch match2)
Completion\CompletionItem.cs (42)
20
public sealed class CompletionItem : IComparable<
CompletionItem
>
163
/// <see cref="
CompletionItem
"/>. Not available to clients. Only used by
215
public static
CompletionItem
Create(
227
public static
CompletionItem
Create(
241
public static
CompletionItem
Create(
257
public static
CompletionItem
Create(
269
var
result = CreateInternal(
278
internal static
CompletionItem
CreateInternal(
305
/// Creates a new <see cref="
CompletionItem
"/>
316
public static
CompletionItem
Create(
325
var
result = new CompletionItem(
343
private
CompletionItem
With(
407
/// Creates a copy of this <see cref="
CompletionItem
"/> with the <see cref="Span"/> property changed.
411
public
CompletionItem
WithSpan(TextSpan span)
415
/// Creates a copy of this <see cref="
CompletionItem
"/> with the <see cref="DisplayText"/> property changed.
417
public
CompletionItem
WithDisplayText(string text)
421
/// Creates a copy of this <see cref="
CompletionItem
"/> with the <see cref="DisplayTextPrefix"/> property changed.
423
public
CompletionItem
WithDisplayTextPrefix(string displayTextPrefix)
427
/// Creates a copy of this <see cref="
CompletionItem
"/> with the <see cref="DisplayTextSuffix"/> property changed.
429
public
CompletionItem
WithDisplayTextSuffix(string displayTextSuffix)
433
/// Creates a copy of this <see cref="
CompletionItem
"/> with the <see cref="FilterText"/> property changed.
435
public
CompletionItem
WithFilterText(string text)
439
/// Creates a copy of this <see cref="
CompletionItem
"/> with the <see cref="SortText"/> property changed.
441
public
CompletionItem
WithSortText(string text)
445
/// Creates a copy of this <see cref="
CompletionItem
"/> with the specified property changed.
447
public
CompletionItem
WithProperties(ImmutableDictionary<string, string> properties)
449
var
result = With(properties: properties.AsImmutableOrNull());
456
internal
CompletionItem
WithProperties(ImmutableArray<KeyValuePair<string, string>> properties)
460
/// Creates a copy of this <see cref="
CompletionItem
"/> with the specified property.
462
public
CompletionItem
AddProperty(string name, string value)
466
/// Creates a copy of this <see cref="
CompletionItem
"/> with the <see cref="Tags"/> property changed.
468
public
CompletionItem
WithTags(ImmutableArray<string> tags)
472
/// Creates a copy of this <see cref="
CompletionItem
"/> with a tag added to the <see cref="Tags"/> collection.
474
public
CompletionItem
AddTag(string tag)
492
/// Creates a copy of this <see cref="
CompletionItem
"/> with the <see cref="Rules"/> property changed.
494
public
CompletionItem
WithRules(CompletionItemRules rules)
498
/// Creates a copy of this <see cref="
CompletionItem
"/> with the <see cref="IsComplexTextEdit"/> property changed.
500
public
CompletionItem
WithIsComplexTextEdit(bool isComplexTextEdit)
504
/// Creates a copy of this <see cref="
CompletionItem
"/> with the <see cref="AdditionalFilterTexts"/> property changed.
506
internal
CompletionItem
WithAdditionalFilterTexts(ImmutableArray<string> additionalFilterTexts)
509
int IComparable<
CompletionItem
>.CompareTo([AllowNull]
CompletionItem
other)
Completion\CompletionItemFlags.cs (2)
15
/// Indicates this <see cref="
CompletionItem
"/> is cached and reused across completion sessions.
25
/// Indicates this <see cref="
CompletionItem
"/> should be shown only when expanded items is requested.
Completion\CompletionItemRules.cs (1)
37
/// The rule used when no rule is specified when constructing a <see cref="
CompletionItem
"/>.
Completion\CompletionList.cs (21)
19
private readonly Lazy<ImmutableArray<
CompletionItem
>> _lazyItems;
26
public ImmutableArray<
CompletionItem
> Items => _lazyItems.Value;
33
public IReadOnlyList<
CompletionItem
> ItemsList { get; }
37
/// Individual <see cref="
CompletionItem
"/> spans may vary.
50
/// to the document. If this is the case, <see cref="
CompletionItem
.IsComplexTextEdit"/> must be
61
/// An optional <see cref="
CompletionItem
"/> that appears selected in the list presented to the user during suggestion mode.
67
public
CompletionItem
? SuggestionModeItem { get; }
76
IReadOnlyList<
CompletionItem
> itemsList,
78
CompletionItem
? suggestionModeItem,
89
foreach (
var
item in ItemsList)
101
/// <param name="suggestionModeItem">An optional <see cref="
CompletionItem
"/> that appears selected in the list presented to the user during suggestion mode.</param>
104
ImmutableArray<
CompletionItem
> items,
106
CompletionItem
? suggestionModeItem = null)
113
IReadOnlyList<
CompletionItem
> itemsList,
115
CompletionItem
? suggestionModeItem,
123
Optional<IReadOnlyList<
CompletionItem
>> itemsList = default,
125
Optional<
CompletionItem
> suggestionModeItem = default)
130
var
newSuggestionModeItem = suggestionModeItem.HasValue ? suggestionModeItem.Value : SuggestionModeItem;
159
public CompletionList WithItems(ImmutableArray<
CompletionItem
> items)
166
internal CompletionList WithItemsList(IReadOnlyList<
CompletionItem
> itemsList)
178
public CompletionList WithSuggestionModeItem(
CompletionItem
suggestionModeItem)
Completion\CompletionProvider.cs (4)
25
/// Implement to contribute <see cref="
CompletionItem
"/>'s and other details to a <see cref="CompletionList"/>
63
public virtual Task<CompletionDescription?> GetDescriptionAsync(Document document,
CompletionItem
item, CancellationToken cancellationToken)
66
internal virtual Task<CompletionDescription?> GetDescriptionAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
78
public virtual Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey, CancellationToken cancellationToken)
Completion\CompletionRules.cs (2)
27
/// Individual <see cref="
CompletionItem
"/>s can override this.
33
/// Individual <see cref="
CompletionItem
"/>s can override this.
Completion\CompletionService.cs (7)
170
/// This is the most common value used for <see cref="
CompletionItem
.Span"/>.
193
CompletionItem
item,
209
internal virtual async Task<CompletionDescription?> GetDescriptionAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken = default)
240
CompletionItem
item,
283
public virtual ImmutableArray<
CompletionItem
> FilterItems(
285
ImmutableArray<
CompletionItem
> items,
393
internal CompletionProvider? GetProvider(
CompletionItem
item, Project? project)
Completion\CompletionService.ProviderManager.cs (1)
151
public CompletionProvider? GetProvider(
CompletionItem
item, Project? project)
Completion\CompletionTags.cs (1)
12
/// The set of well known tags used for the <see cref="
CompletionItem
.Tags"/> property.
Completion\FileSystemCompletionHelper.cs (9)
86
private
CompletionItem
CreateNetworkRoot()
94
private
CompletionItem
CreateUnixRoot()
102
private
CompletionItem
CreateFileSystemEntryItem(string fullPath, bool isDirectory)
110
private
CompletionItem
CreateLogicalDriveItem(string drive)
118
public Task<ImmutableArray<
CompletionItem
>> GetItemsAsync(string directoryPath, CancellationToken cancellationToken)
121
private ImmutableArray<
CompletionItem
> GetItems(string directoryPath, CancellationToken cancellationToken)
129
var result = ArrayBuilder<
CompletionItem
>.GetInstance();
214
private IEnumerable<
CompletionItem
> GetItemsInDirectory(string fullDirectoryPath, CancellationToken cancellationToken)
263
internal ImmutableArray<
CompletionItem
> GetItems(string directoryPath, CancellationToken cancellationToken)
Completion\INotifyCommittingItemCompletionProvider.cs (1)
24
Task NotifyCommittingItemAsync(Document document,
CompletionItem
item, char? commitKey, CancellationToken cancellationToken);
Completion\MatchResult.cs (3)
11
CompletionItem
completionItem,
21
public readonly
CompletionItem
CompletionItem = completionItem;
31
public string FilterTextUsed => MatchedAdditionalFilterText ??
CompletionItem
.FilterText;
Completion\PatternMatchHelper.cs (3)
99
CompletionItem
item,
132
public bool MatchesPattern(
CompletionItem
item, CultureInfo culture)
136
CompletionItem
item,
Completion\Providers\AbstractAggregateEmbeddedLanguageCompletionProvider.cs (3)
107
public override Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey, CancellationToken cancellationToken)
110
internal override Task<CompletionDescription?> GetDescriptionAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
113
private IEmbeddedLanguage GetLanguage(
CompletionItem
item)
Completion\Providers\AbstractAwaitCompletionProvider.cs (2)
147
static
CompletionItem
CreateCompletionItem(
166
public sealed override async Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey, CancellationToken cancellationToken)
Completion\Providers\AbstractCrefCompletionProvider.cs (1)
19
Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\Providers\AbstractDocCommentCompletionProvider.cs (20)
91
protected abstract Task<IEnumerable<
CompletionItem
>?> GetItemsWorkerAsync(Document document, int position, CompletionTrigger trigger, CancellationToken cancellationToken);
104
private
CompletionItem
GetItem(string name)
116
protected IEnumerable<
CompletionItem
> GetAttributeItems(string tagName, ISet<string> existingAttributes, bool addEqualsAndQuotes)
126
protected IEnumerable<
CompletionItem
> GetAlwaysVisibleItems()
129
private
CompletionItem
GetCommentItem()
136
private
CompletionItem
GetCDataItem()
143
protected IEnumerable<
CompletionItem
> GetNestedItems(ISymbol? symbol, bool includeKeywords)
161
private IEnumerable<
CompletionItem
> GetParamRefItems(ISymbol symbol)
171
private IEnumerable<
CompletionItem
> GetTypeParamRefItems(ISymbol symbol)
181
protected IEnumerable<
CompletionItem
> GetAttributeValueItems(ISymbol? symbol, string tagName, string attributeName)
213
protected ImmutableArray<
CompletionItem
> GetTopLevelItems(ISymbol? symbol, TSyntax syntax)
215
using var _1 = ArrayBuilder<
CompletionItem
>.GetInstance(out var items);
252
protected IEnumerable<
CompletionItem
> GetItemTagItems()
255
protected IEnumerable<
CompletionItem
> GetListItems()
258
protected IEnumerable<
CompletionItem
> GetListHeaderItems()
261
private IEnumerable<
CompletionItem
> GetParameterItems<TSymbol>(ImmutableArray<TSymbol> symbols, TSyntax syntax, string tagName) where TSymbol : ISymbol
274
public override async Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitChar = null, CancellationToken cancellationToken = default)
309
private
CompletionItem
CreateCompletionItem(string displayText)
317
private
CompletionItem
CreateLangwordCompletionItem(string displayText)
325
protected
CompletionItem
CreateCompletionItem(string displayText, string beforeCaretText, string afterCaretText)
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (2)
155
var
completionItem = CommonCompletionItem.Create(
268
public override async Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey = null, CancellationToken cancellationToken = default)
Completion\Providers\AbstractKeywordCompletionProvider.cs (7)
29
protected abstract
CompletionItem
CreateItem(RecommendedKeyword keyword, TContext context, CancellationToken cancellationToken);
43
private async Task<ImmutableArray<
CompletionItem
>> RecommendCompletionItemsAsync(Document document, CompletionContext context, CancellationToken cancellationToken)
73
public sealed override Task<TextChange?> GetTextChangeAsync(Document document,
CompletionItem
item, char? ch, CancellationToken cancellationToken)
76
private sealed class Comparer : IEqualityComparer<
CompletionItem
>
78
public bool Equals(
CompletionItem
? x,
CompletionItem
? y)
81
public int GetHashCode(
CompletionItem
obj)
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (6)
36
protected abstract SyntaxToken GetToken(
CompletionItem
completionItem, SyntaxTree tree, CancellationToken cancellationToken);
39
Document document,
CompletionItem
item, Compilation compilation, ISymbol member, INamedTypeSymbol containingType, CancellationToken cancellationToken);
46
public override async Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey = null, CancellationToken cancellationToken = default)
78
CompletionItem
completionItem,
138
CompletionItem
completionItem,
227
internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
26
protected override
CompletionItem
CreateItem(
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
84
internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\Providers\AbstractOverrideCompletionProvider.BaseItemGetter.cs (1)
54
public abstract Task<ImmutableArray<
CompletionItem
>> GetItemsAsync();
Completion\Providers\AbstractOverrideCompletionProvider.cs (1)
35
Document document,
CompletionItem
completionItem, Compilation compilation, ISymbol overriddenMember, INamedTypeSymbol containingType, CancellationToken cancellationToken)
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (2)
46
public override async Task<ImmutableArray<
CompletionItem
>> GetItemsAsync()
69
private
CompletionItem
CreateItem(
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (3)
63
Document document,
CompletionItem
item, Compilation compilation, ISymbol member, INamedTypeSymbol containingType, CancellationToken cancellationToken)
82
protected async Task<IEnumerable<
CompletionItem
>?> CreatePartialItemsAsync(
105
private
CompletionItem
CreateItem(IMethodSymbol method, int line, TextSpan span, SemanticModel semanticModel, DeclarationModifiers modifiers, SyntaxToken token)
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (3)
61
private
CompletionItem
CreateCompletionItem(INamedTypeSymbol symbol, TSyntaxContext context)
110
internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
113
public override Task<TextChange?> GetTextChangeAsync(Document document,
CompletionItem
selectedItem, char? ch, CancellationToken cancellationToken)
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (2)
133
protected override
CompletionItem
CreateItem(
204
Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\Providers\AbstractSuggestionModeCompletionProvider.cs (2)
14
protected abstract Task<
CompletionItem
?> GetSuggestionModeItemAsync(Document document, int position, TextSpan span, CompletionTrigger triggerInfo, CancellationToken cancellationToken);
22
protected static
CompletionItem
CreateEmptySuggestionModeItem()
Completion\Providers\AbstractSymbolCompletionProvider.cs (10)
37
protected abstract
CompletionItem
CreateItem(
97
private ImmutableArray<
CompletionItem
> CreateItems(
125
using var _ = ArrayBuilder<
CompletionItem
>.GetInstance(out var itemListBuilder);
152
var
item = CreateItem(
220
protected static
CompletionItem
CreateItemDefault(
249
internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
289
private async Task<ImmutableArray<
CompletionItem
>> GetItemsAsync(
419
public sealed override Task<TextChange?> GetTextChangeAsync(Document document,
CompletionItem
selectedItem, char? ch, CancellationToken cancellationToken)
422
private string GetInsertionText(
CompletionItem
item, char? ch)
432
protected virtual string GetInsertionText(
CompletionItem
item, char ch)
Completion\Providers\EmbeddedLanguageCompletionProvider.cs (2)
24
public abstract Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey, CancellationToken cancellationToken);
25
public abstract Task<CompletionDescription?> GetDescriptionAsync(Document document,
CompletionItem
item, CancellationToken cancellationToken);
Completion\Providers\ImportCompletionProvider\AbstractExtensionMethodImportCompletionProvider.cs (1)
114
private
CompletionItem
Convert(SerializableImportCompletionItem serializableItem, string receiverTypeSymbolKey)
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (4)
25
protected abstract Task<bool> ShouldProvideParenthesisCompletionAsync(Document document,
CompletionItem
item, char? commitKey, CancellationToken cancellationToken);
28
public Task NotifyCommittingItemAsync(Document document,
CompletionItem
item, char? commitKey, CancellationToken cancellationToken)
116
Document document,
CompletionItem
completionItem, char? commitKey, CancellationToken cancellationToken)
219
internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionProvider.cs (3)
117
ImmutableArray<
CompletionItem
> items,
124
foreach (
var
item in items)
138
CompletionItem
item,
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (2)
44
public async Task<(ImmutableArray<ImmutableArray<
CompletionItem
>>, bool)> GetAllTopLevelTypesAsync(
56
ImmutableArray<
CompletionItem
> GetItemsFromCacheResult(TypeImportCompletionCacheEntry cacheEntry)
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (16)
32
public static
CompletionItem
Create(
74
var
item =
CompletionItem
.CreateInternal(
94
public static
CompletionItem
CreateAttributeItemWithoutSuffix(
CompletionItem
attributeItem, string attributeNameWithoutSuffix, CompletionItemFlags flags)
108
var
item =
CompletionItem
.CreateInternal(
131
public static
CompletionItem
CreateItemWithGenericDisplaySuffix(
CompletionItem
item, string genericTypeSuffix)
134
public static string GetContainingNamespace(
CompletionItem
item)
137
public static async Task<CompletionDescription> GetCompletionDescriptionAsync(Document document,
CompletionItem
item, SymbolDescriptionOptions options, CancellationToken cancellationToken)
160
public static string GetTypeName(
CompletionItem
item)
177
private static (ISymbol? symbol, int overloadCount) GetSymbolAndOverloadCount(
CompletionItem
item, Compilation compilation)
220
public static
CompletionItem
MarkItemToAlwaysFullyQualify(
CompletionItem
item)
227
public static bool ShouldAlwaysFullyQualify(
CompletionItem
item) => item.TryGetProperty(AlwaysFullyQualifyKey, out var _);
Completion\Providers\ImportCompletionProvider\ITypeImportCompletionService.cs (1)
24
Task<(ImmutableArray<ImmutableArray<
CompletionItem
>>, bool)> GetAllTopLevelTypesAsync(
Completion\Providers\ImportCompletionProvider\TypeImportCompletionCacheEntry.cs (7)
55
public ImmutableArray<
CompletionItem
> GetItemsForContext(
72
using var _ = ArrayBuilder<
CompletionItem
>.GetInstance(out var builder);
134
static
CompletionItem
GetAppropriateAttributeItem(
CompletionItem
attributeItem, bool isCaseSensitive)
197
var
item = ImportCompletionItem.Create(
216
private readonly struct TypeImportCompletionItemInfo(
CompletionItem
item, bool isPublic, bool isGeneric, bool isAttribute, bool isEditorBrowsableStateAdvanced, bool isEnumBaseType)
224
public
CompletionItem
Item { get; } = item;
Completion\Providers\MemberInsertingCompletionItem.cs (5)
15
public static
CompletionItem
Create(
38
public static Task<CompletionDescription> GetDescriptionAsync(
CompletionItem
item, Document document, SymbolDescriptionOptions options, CancellationToken cancellationToken)
41
public static DeclarationModifiers GetModifiers(
CompletionItem
item)
52
public static int GetLine(
CompletionItem
item)
63
public static int GetTokenSpanEnd(
CompletionItem
item)
Completion\Providers\Scripting\GlobalAssemblyCacheCompletionHelper.cs (3)
32
public Task<ImmutableArray<
CompletionItem
>> GetItemsAsync(string directoryPath, CancellationToken cancellationToken)
36
internal ImmutableArray<
CompletionItem
> GetItems(string directoryPath, CancellationToken cancellationToken)
38
using var resultDisposer = ArrayBuilder<
CompletionItem
>.GetInstance(out var result);
Completion\Providers\Snippets\AbstractSnippetCompletionProvider.cs (3)
22
public override async Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey = null, CancellationToken cancellationToken = default)
89
var
completionItem = SnippetCompletionItem.Create(
102
internal override async Task<CompletionDescription?> GetDescriptionAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\Providers\Snippets\SnippetCompletionItem.cs (4)
15
public static
CompletionItem
Create(
42
public static string GetSnippetIdentifier(
CompletionItem
item)
48
public static int GetInvocationPosition(
CompletionItem
item)
55
public static bool IsSnippet(
CompletionItem
item)
Completion\Providers\SymbolCompletionItem.cs (21)
29
private static
CompletionItem
CreateWorker(
64
var
item = CommonCompletionItem.Create(
95
public static
CompletionItem
AddShouldProvideParenthesisCompletion(
CompletionItem
item)
98
public static bool GetShouldProvideParenthesisCompletion(
CompletionItem
item)
127
public static bool HasSymbols(
CompletionItem
item)
132
public static async Task<ImmutableArray<ISymbol>> GetSymbolsAsync(
CompletionItem
item, Document document, CancellationToken cancellationToken)
185
CompletionItem
item, Document document, SymbolDescriptionOptions options, CancellationToken cancellationToken)
192
CompletionItem
item, Document document, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken)
232
public static SupportedPlatformData? GetSupportedPlatforms(
CompletionItem
item, Solution solution)
246
public static int GetContextPosition(
CompletionItem
item)
259
public static int GetDescriptionPosition(
CompletionItem
item)
262
public static string GetInsertionText(
CompletionItem
item)
265
public static bool TryGetInsertionText(
CompletionItem
item, [NotNullWhen(true)] out string? insertionText)
269
public static
CompletionItem
CreateWithSymbolId(
300
public static
CompletionItem
CreateWithSymbolId(
324
public static
CompletionItem
CreateWithNameAndKind(
348
internal static string? GetSymbolName(
CompletionItem
item)
351
internal static SymbolKind? GetKind(
CompletionItem
item)
354
internal static bool GetSymbolIsGeneric(
CompletionItem
item)
358
CompletionItem
item, ImmutableArray<ISymbol> symbols, Document document, SemanticModel semanticModel, SymbolDescriptionOptions options, CancellationToken cancellationToken)
Completion\Providers\UnionCompletionItemComparer.cs (4)
11
internal sealed class UnionCompletionItemComparer : IEqualityComparer<
CompletionItem
>
19
public bool Equals(
CompletionItem
? x,
CompletionItem
? y)
23
public int GetHashCode(
CompletionItem
obj)
Completion\Providers\XmlDocCommentCompletionItem.cs (3)
14
public static
CompletionItem
Create(string displayText, string beforeCaretText, string afterCaretText, CompletionItemRules rules)
32
public static string GetBeforeCaretText(
CompletionItem
item)
35
public static string? GetAfterCaretText(
CompletionItem
item)
Completion\Utilities.cs (1)
47
public static bool IsPreferredItem(this
CompletionItem
completionItem)
EmbeddedLanguages\DateAndTime\DateAndTimeEmbeddedCompletionProvider.cs (3)
121
context.AddItem(
CompletionItem
.CreateInternal(
215
public override Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey, CancellationToken cancellationToken)
230
public override Task<CompletionDescription?> GetDescriptionAsync(Document document,
CompletionItem
item, CancellationToken cancellationToken)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (3)
113
context.AddItem(
CompletionItem
.CreateInternal(
445
public override Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey, CancellationToken cancellationToken)
460
public override Task<CompletionDescription> GetDescriptionAsync(Document document,
CompletionItem
item, CancellationToken cancellationToken)
ExternalAccess\Pythia\Api\PythiaCompletionProviderBase.cs (8)
21
public static
CompletionItem
CreateCommonCompletionItem(
35
public static
CompletionItem
CreateSymbolCompletionItem(
52
public static Task<CompletionDescription> GetDescriptionAsync(
CompletionItem
item, Document document, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
57
public static CompletionDescription GetDescription(
CompletionItem
item)
61
Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
70
public static bool TryGetInsertionText(
CompletionItem
item, [NotNullWhen(true)] out string? insertionText)
79
public override Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey = null, CancellationToken cancellationToken = default)
82
public virtual Task NotifyCommittingItemAsync(Document document,
CompletionItem
item, char? commitKey, CancellationToken cancellationToken)
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (3)
34
protected abstract bool IsGeneric(
CompletionItem
completionItem);
155
foreach (
var
item in completionList.ItemsList)
200
private static async Task<string> GetInsertionTextAsync(Document document,
CompletionItem
item, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer (2)
Services\StarredCompletions\StarredCompletionProvider.cs (2)
30
public override async Task<CompletionChange> GetChangeAsync(Document document,
CompletionItem
item, char? commitKey = null, CancellationToken cancellationToken = default)
37
internal override async Task<CompletionDescription?> GetDescriptionAsync(Document document,
CompletionItem
item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.Protocol (15)
Handler\Completion\CompletionHandler.cs (1)
218
foreach (
var
item in completionList.ItemsList)
Handler\Completion\CompletionResolveHandler.cs (2)
92
var
roslynItem = cachedCompletionList.ItemsList
116
private static bool MatchesLSPCompletionItem(LSP.CompletionItem lspCompletionItem,
CompletionItem
completionItem)
Handler\Completion\CompletionResultFactory.cs (12)
75
foreach (
var
item in list.ItemsList)
109
async Task<LSP.CompletionItem> CreateLSPCompletionItemAsync(
CompletionItem
item, string typedText)
229
CompletionItem
item,
317
CompletionItem
item,
365
CompletionItem
item,
503
CompletionItem
item,
521
CompletionItem
selectedItem,
546
private static async Task<CompletionChange> GetCompletionChangeOrDisplayNameInCaseOfExceptionAsync(CompletionService completionService, Document document,
CompletionItem
completionItem, CancellationToken cancellationToken)
561
CompletionItem
roslynItem,
577
CompletionItem
roslynItem,
627
CompletionItem
roslynItem,
668
CompletionItem
selectedItem,
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (14)
Completion\CompletionFeaturesTests.cs (10)
600
var builder = ImmutableArray.CreateBuilder<CodeAnalysis.Completion.
CompletionItem
>();
603
builder.Add(CodeAnalysis.Completion.
CompletionItem
.Create($"ItemWithDefaultChar{i}", rules: CompletionItemRules.Default));
606
builder.Add(CodeAnalysis.Completion.
CompletionItem
.Create($"ItemNonDefaultChar{i}", rules: NonDefaultRule));
882
public ImmutableArray<CodeAnalysis.Completion.
CompletionItem
> ReturnedItems { get; set; } = [];
896
public override Task<CompletionChange> GetChangeAsync(Document document, CodeAnalysis.Completion.
CompletionItem
item, char? commitCharacter = null, CancellationToken cancellationToken = default)
930
var builder = ImmutableArray.CreateBuilder<CodeAnalysis.Completion.
CompletionItem
>();
931
builder.Add(CodeAnalysis.Completion.
CompletionItem
.Create("SimpleItem"));
933
var
importItem = CodeAnalysis.Completion.
CompletionItem
.Create("ExpandedItem");
937
builder.Add(CodeAnalysis.Completion.
CompletionItem
.Create("ComplexItem", isComplexTextEdit: true));
Completion\CompletionResolveTests.cs (4)
184
var
selectedItem = CodeAnalysis.Completion.
CompletionItem
.Create(displayText: "M", isComplexTextEdit: true);
499
CodeAnalysis.Completion.
CompletionItem
item,
517
internal override Task<CompletionDescription> GetDescriptionAsync(Document document, CodeAnalysis.Completion.
CompletionItem
item, CodeAnalysis.Completion.CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken = default)
Microsoft.CodeAnalysis.VisualBasic.Features (34)
Completion\CompletionProviders\CompletionListTagCompletionProvider.vb (1)
99
supportedPlatformData As SupportedPlatformData) As
CompletionItem
Completion\CompletionProviders\CompletionUtilities.vb (1)
127
Public Function GetInsertionTextAtInsertionTime(item As
CompletionItem
, ch As Char) As String
Completion\CompletionProviders\CrefCompletionProvider.vb (3)
198
symbols As IEnumerable(Of ISymbol), position As Integer) As IEnumerable(Of
CompletionItem
)
213
symbol As ISymbol, position As Integer, builder As StringBuilder) As
CompletionItem
256
Private Shared Function CreateOfCompletionItem() As
CompletionItem
Completion\CompletionProviders\EnumCompletionProvider.vb (2)
131
supportedPlatformData As SupportedPlatformData) As
CompletionItem
157
Protected Overrides Function GetInsertionText(item As
CompletionItem
, ch As Char) As String
Completion\CompletionProviders\HandlesClauseCompletionProvider.vb (2)
160
Protected Overrides Function GetInsertionText(item As
CompletionItem
, ch As Char) As String
164
Protected Overrides Function CreateItem(completionContext As CompletionContext, displayText As String, displayTextSuffix As String, insertionText As String, symbols As ImmutableArray(Of SymbolAndSelectionInfo), context As VisualBasicSyntaxContext, supportedPlatformData As SupportedPlatformData) As
CompletionItem
Completion\CompletionProviders\ImplementsClauseCompletionProvider.vb (2)
307
supportedPlatformData As SupportedPlatformData) As
CompletionItem
319
Protected Overrides Function GetInsertionText(item As
CompletionItem
, ch As Char) As String
Completion\CompletionProviders\ImportCompletionProvider\ExtensionMethodImportCompletionProvider.vb (1)
48
Protected Overrides Function ShouldProvideParenthesisCompletionAsync(document As Document, item As
CompletionItem
, commitKey As Char?, cancellationToken As CancellationToken) As Task(Of Boolean)
Completion\CompletionProviders\ImportCompletionProvider\TypeImportCompletionProvider.vb (1)
43
Protected Overrides Function ShouldProvideParenthesisCompletionAsync(document As Document, item As
CompletionItem
, commitKey As Char?, cancellationToken As CancellationToken) As Task(Of Boolean)
Completion\CompletionProviders\KeywordCompletionProvider.vb (1)
186
Protected Overrides Function CreateItem(keyword As RecommendedKeyword, context As VisualBasicSyntaxContext, cancellationToken As CancellationToken) As
CompletionItem
Completion\CompletionProviders\NamedParameterCompletionProvider.vb (2)
110
Friend Overrides Function GetDescriptionWorkerAsync(document As Document, item As
CompletionItem
, options As CompletionOptions, displayOptions As SymbolDescriptionOptions, cancellationToken As CancellationToken) As Task(Of CompletionDescription)
230
Protected Overrides Function GetTextChangeAsync(selectedItem As
CompletionItem
, ch As Char?, cancellationToken As CancellationToken) As Task(Of TextChange?)
Completion\CompletionProviders\OverrideCompletionProvider.vb (1)
55
Protected Overrides Function GetToken(completionItem As
CompletionItem
, syntaxTree As SyntaxTree, cancellationToken As CancellationToken) As SyntaxToken
Completion\CompletionProviders\PartialTypeCompletionProvider.vb (1)
73
Public Overrides Async Function GetTextChangeAsync(document As Document, selectedItem As
CompletionItem
, ch As Char?, cancellationToken As CancellationToken) As Task(Of TextChange?)
Completion\CompletionProviders\SymbolCompletionProvider.vb (1)
78
Protected Overrides Function GetInsertionText(item As
CompletionItem
, ch As Char) As String
Completion\CompletionProviders\VisualBasicSuggestionModeCompletionProvider.vb (1)
33
Protected Overrides Async Function GetSuggestionModeItemAsync(document As Document, position As Integer, itemSpan As TextSpan, trigger As CompletionTrigger, cancellationToken As CancellationToken) As Task(Of
CompletionItem
)
Completion\CompletionProviders\XmlDocCommentCompletionProvider.vb (7)
68
Protected Overrides Async Function GetItemsWorkerAsync(document As Document, position As Integer, trigger As CompletionTrigger, cancellationToken As CancellationToken) As Task(Of IEnumerable(Of
CompletionItem
))
100
Dim items = New List(Of
CompletionItem
)()
181
Return SpecializedCollections.EmptyEnumerable(Of
CompletionItem
)
185
Private Sub AddXmlElementItems(items As List(Of
CompletionItem
), xmlElement As SyntaxNode)
196
Private Function GetCloseTagItem(token As SyntaxToken) As IEnumerable(Of
CompletionItem
)
227
items As List(Of
CompletionItem
),
337
Private Function GetAttributes(token As SyntaxToken, tagName As String, attributes As SyntaxList(Of XmlNodeSyntax)) As IEnumerable(Of
CompletionItem
)
Completion\VisualBasicCompletionService.vb (6)
75
Protected Overrides Function GetBetterItem(item As
CompletionItem
, existingItem As
CompletionItem
) As
CompletionItem
85
Protected Overrides Function ItemsMatch(item As
CompletionItem
, existingItem As
CompletionItem
) As Boolean
111
Private Function GetChangeText(item As
CompletionItem
) As String
SpellCheck\VisualBasicSpellCheckCodeFixProvider.vb (1)
69
Protected Overrides Function IsGeneric(completionItem As
CompletionItem
) As Boolean
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Completion\MockCompletionProvider.vb (1)
26
Public Overrides Function GetTextChangeAsync(document As Document, selectedItem As
CompletionItem
, ch As Char?, cancellationToken As CancellationToken) As Task(Of TextChange?)
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
Snippets\SnippetCompletionProvider.vb (2)
80
Private Shared Function CreateCompletionItems(snippets As IEnumerable(Of SnippetInfo)) As IEnumerable(Of
CompletionItem
)
96
Public Sub Commit(completionItem As
CompletionItem
,