12 instantiations of ClassifiedTextElement
Microsoft.CodeAnalysis.EditorFeatures (1)
Extensions\LSPExtensions.cs (1)
21=> new(element.Runs.Select(r => r.ToLSPRun()));
Microsoft.CodeAnalysis.LanguageServer.Protocol (8)
Extensions\Extensions.cs (2)
257=> new ClassifiedTextElement(definition.DisplayParts.Select(part => new ClassifiedTextRun(part.Tag.ToClassificationTypeName(), part.Text))); 325=> new(element.Runs.Select(ToLSPRun));
Handler\Completion\CompletionResultFactory.cs (1)
648vsCompletionItem.Description = new ClassifiedTextElement(description.TaggedParts
Handler\References\FindUsagesLSPContext.cs (1)
316return new ClassifiedTextElement([.. classifiedTextRuns]);
Handler\SignatureHelp\SignatureHelpHandler.cs (1)
163return new ClassifiedTextElement(taggedTexts.ToArray().Select(part => new ClassifiedTextRun(part.Tag.ToClassificationTypeName(), part.Text)));
Protocol\Internal\Converters\ClassifiedTextElementConverter.cs (1)
25return new ClassifiedTextElement(objects);
Protocol\Internal\Text\ClassifiedTextElement.cs (2)
34return new ClassifiedTextElement(new ClassifiedTextRun("text", text, navigationAction: navigationAction, tooltip: tooltip)); 40return new ClassifiedTextElement(new ClassifiedTextRun("text", text));
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Completion\CompletionResolveTests.cs (2)
67var description = new ClassifiedTextElement(CreateClassifiedTextRunForClass("A")); 91var description = new ClassifiedTextElement(CreateClassifiedTextRunForClass("A"));
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Implementation\LanguageServer\Handler\Completion\CompletionResolveHandler.cs (1)
82vsCompletionItem.Description = new ClassifiedTextElement(description.Select(tp => new ClassifiedTextRun(tp.Tag.ToClassificationTypeName(), tp.Text)));
48 references to ClassifiedTextElement
Microsoft.CodeAnalysis.EditorFeatures (1)
Extensions\LSPExtensions.cs (1)
20public static Roslyn.Text.Adornments.ClassifiedTextElement ToLSPElement(this VisualStudio.Text.Adornments.ClassifiedTextElement element)
Microsoft.CodeAnalysis.LanguageServer.Protocol (35)
Extensions\Extensions.cs (2)
256public static ClassifiedTextElement GetClassifiedText(this DefinitionItem definition) 324public static ClassifiedTextElement ToLSPElement(this QuickInfoClassifiedTextElement element)
Extensions\ProtocolConversions.cs (1)
375DocumentSpan documentSpan, ClassifiedTextElement text, CancellationToken cancellationToken)
Handler\References\FindImplementationsHandler.cs (1)
59var text = definition.GetClassifiedText();
Handler\References\FindUsagesLSPContext.cs (6)
183ClassifiedTextElement? definitionText, 191var text = await ComputeTextAsync(definitionId, documentSpan, definitionText, isWrittenTo, cancellationToken).ConfigureAwait(false); 205ClassifiedTextElement text, 208ClassifiedTextElement? definitionText, 296private async Task<ClassifiedTextElement?> ComputeTextAsync( 299ClassifiedTextElement? definitionText,
Handler\SignatureHelp\SignatureHelpHandler.cs (1)
139private static ClassifiedTextElement GetSignatureClassifiedText(SignatureHelpItem item)
Protocol\Internal\Converters\ClassifiedTextElementConverter.cs (8)
13internal sealed class ClassifiedTextElementConverter : JsonConverter<ClassifiedTextElement> 17public override ClassifiedTextElement Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 34case nameof(ClassifiedTextElement.Runs): 45if (reader.GetString() != nameof(ClassifiedTextElement)) 46throw new JsonException($"Expected {ObjectContentConverter.TypeProperty} property value {nameof(ClassifiedTextElement)}"); 58public override void Write(Utf8JsonWriter writer, ClassifiedTextElement value, JsonSerializerOptions options) 61writer.WritePropertyName(nameof(ClassifiedTextElement.Runs)); 70writer.WriteStringValue(nameof(ClassifiedTextElement));
Protocol\Internal\Converters\ObjectContentConverter.cs (4)
21/// <item><description><see cref="ClassifiedTextElement"/></description></item>, 60case nameof(ClassifiedTextElement): 102case ClassifiedTextElement: 103ClassifiedTextElementConverter.Instance.Write(writer, (ClassifiedTextElement)value, options);
Protocol\Internal\Text\ClassifiedTextElement.cs (2)
30public static ClassifiedTextElement CreateHyperlink(string text, string tooltip, Action navigationAction) 37public static ClassifiedTextElement CreatePlainText(string text)
Protocol\Internal\VSInternalCompletionItem.cs (1)
34public ClassifiedTextElement? Description { get; set; }
Protocol\Internal\VSInternalLocation.cs (2)
19/// Gets or sets the text value for a location reference. Must be of type <see cref="ImageElement"/> or <see cref="ContainerElement"/> or <see cref="ClassifiedTextElement"/> or <see cref="string"/>. 33if (value is ImageElement or ContainerElement or ClassifiedTextElement or string)
Protocol\Internal\VSInternalReferenceItem.cs (6)
53/// Must be of type <see cref="string"/>, <see cref="ClassifiedTextElement"/>, <see cref="ContainerElement"/> and <see cref="ImageElement"/>. 57/// embedded within <see cref="ClassifiedTextElement"/> should not define <see cref="ClassifiedTextRun.MarkerTagType"/>. 72if (value is null or ImageElement or ContainerElement or ClassifiedTextElement or string) 133/// Must be of type <see cref="ImageElement"/> or <see cref="ContainerElement"/> or <see cref="ClassifiedTextElement"/> or <see cref="string"/>. 139/// on <see cref="ClassifiedTextRun"/> embedded within <see cref="ClassifiedTextElement"/>. 160if (value is ImageElement or ContainerElement or ClassifiedTextElement or string)
Protocol\Internal\VSInternalSignatureInformation.cs (1)
21public ClassifiedTextElement? ColorizedLabel
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (12)
Completion\CompletionResolveTests.cs (3)
67var description = new ClassifiedTextElement(CreateClassifiedTextRunForClass("A")); 91var description = new ClassifiedTextElement(CreateClassifiedTextRunForClass("A")); 431ClassifiedTextElement description,
Hover\HoverTests.cs (3)
616using var _ = ArrayBuilder<ClassifiedTextElement>.GetInstance(out var classifiedTextElements); 623private static void GetClassifiedTextElements(ContainerElement container, ArrayBuilder<ClassifiedTextElement> classifiedTextElements) 627if (element is ClassifiedTextElement classifiedTextElement)
References\FindAllReferencesHandlerTests.cs (6)
131var textElement = results[0].Text as ClassifiedTextElement; 285var textRuns = ((ClassifiedTextElement)results.First().Text).Runs; 427item => ((ClassifiedTextElement)item.Text).Runs.Where(run => run.MarkerTagType == ReferenceHighlightingConstants.DefinitionTagId)).Where(i => i.Any()).Count(); 429item => ((ClassifiedTextElement)item.Text).Runs.Where(run => run.MarkerTagType == ReferenceHighlightingConstants.WrittenReferenceTagId)).Where(i => i.Any()).Count(); 431item => ((ClassifiedTextElement)item.Text).Runs.Where(run => run.MarkerTagType == ReferenceHighlightingConstants.ReferenceTagId)).Where(i => i.Any()).Count();