public static CompletionItem AddSymbolInfo(IReadOnlyList <ISymbol> symbols, CompletionItem item) { var symbol = symbols[0]; var isGeneric = symbol.GetArity() > 0; item = item .AddProperty("SymbolKind", ((int)symbol.Kind).ToString()) .AddProperty("SymbolName", symbol.Name); return(isGeneric ? item.AddProperty("IsGeneric", isGeneric.ToString()) : item); }
public static CompletionItem AddSymbolNameAndKind(IReadOnlyList <ISymbol> symbols, CompletionItem item) { var symbol = symbols[0]; return(item.AddProperty("SymbolKind", ((int)symbol.Kind).ToString()) .AddProperty("SymbolName", symbol.Name)); }
private static CompletionItem WithSupportedPlatforms(CompletionItem completionItem, SupportedPlatformData supportedPlatforms) { if (supportedPlatforms != null) { return(completionItem .AddProperty("InvalidProjects", string.Join(";", supportedPlatforms.InvalidProjects.Select(id => id.Id))) .AddProperty("CandidateProjects", string.Join(";", supportedPlatforms.CandidateProjects.Select(id => id.Id)))); } else { return(completionItem); } }
public static async Task <CompletionDescription> GetUnimportedDescriptionAsync(Document document, CompletionItem item, ISymbol symbol, CancellationToken cancellationToken) { string symbolKey = SymbolCompletionItem.EncodeSymbol(symbol); item = item.AddProperty(CompletionItemProperties.Symbols, symbolKey); var description = await SymbolCompletionItem.GetDescriptionAsync(item, document, cancellationToken).ConfigureAwait(false); // Adding 'unimported' text to beginning var unimportedTextParts = ImmutableArray <TaggedText> .Empty .Add(new TaggedText(TextTags.Text, "(unimported)")) .Add(new TaggedText(TextTags.Space, " ")) .AddRange(description.TaggedParts); return(description.WithTaggedParts(unimportedTextParts)); }
private static CompletionItem WithSupportedPlatforms(CompletionItem completionItem, SupportedPlatformData supportedPlatforms) { if (supportedPlatforms != null) { return completionItem .AddProperty("InvalidProjects", string.Join(";", supportedPlatforms.InvalidProjects.Select(id => id.Id))) .AddProperty("CandidateProjects", string.Join(";", supportedPlatforms.CandidateProjects.Select(id => id.Id))); } else { return completionItem; } }
public static CompletionItem AddSymbolEncoding(IReadOnlyList <ISymbol> symbols, CompletionItem item) { return(item.AddProperty("Symbols", EncodeSymbols(symbols))); }
public static CompletionItem AddShouldProvideParenthesisCompletion(CompletionItem item) => item.AddProperty("ShouldProvideParenthesisCompletion", true.ToString());
private CompletionItem FixItem(CompletionItem item) { // remember provider so we can find it again later item = item.AddProperty("Provider", this.Provider.Name); item.Span = this.CompletionListSpan; return item; }
public static CompletionItem AddSymbolEncoding(ISymbol symbol, CompletionItem item) { return(item.AddProperty("Symbols", EncodeSymbol(symbol))); }
private CompletionItem FixItem(CompletionItem item) { // remember provider so we can find it again later item = item.AddProperty("Provider", this.Provider.Name); // assign the default span if not set by provider if (item.Span == default(TextSpan) && this.DefaultItemSpan != default(TextSpan)) { item = item.WithSpan(this.DefaultItemSpan); } return item; }