16 instantiations of SumType
Microsoft.CodeAnalysis.LanguageServer.Protocol (14)
Handler\Hover\HoverHandler.cs (1)
124Contents = new SumType<string, MarkedString, SumType<string, MarkedString>[], MarkupContent>(string.Empty),
Protocol\SumType.cs (13)
573public static implicit operator SumType<T1, T2, T3, T4>(T1 val) => new(val); 579public static implicit operator SumType<T1, T2, T3, T4>?(T1? val) => val is null ? null : new SumType<T1, T2, T3, T4>(val); 585public static implicit operator SumType<T1, T2, T3, T4>(T2 val) => new(val); 591public static implicit operator SumType<T1, T2, T3, T4>?(T2? val) => val is null ? null : new SumType<T1, T2, T3, T4>(val); 597public static implicit operator SumType<T1, T2, T3, T4>(T3 val) => new(val); 603public static implicit operator SumType<T1, T2, T3, T4>?(T3? val) => val is null ? null : new SumType<T1, T2, T3, T4>(val); 609public static implicit operator SumType<T1, T2, T3, T4>(T4 val) => new(val); 615public static implicit operator SumType<T1, T2, T3, T4>?(T4? val) => val is null ? null : new SumType<T1, T2, T3, T4>(val); 623(v) => new SumType<T1, T2, T3, T4>(v), 624(v) => new SumType<T1, T2, T3, T4>(v)); 632(v) => new SumType<T1, T2, T3, T4>(v), 633(v) => new SumType<T1, T2, T3, T4>(v), 634(v) => new SumType<T1, T2, T3, T4>(v));
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
CodeActions\CodeActionResolveTests.cs (1)
603locations => new SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>(new RenameFile() { OldDocumentUri = locations.oldUri, NewDocumentUri = locations.newUri })).ToArray()
Microsoft.CodeAnalysis.Razor.Workspaces (1)
Extensions\LspExtensions_WorkspaceEdit.cs (1)
104builder.Add(new SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>(textDocumentEdit));
108 references to SumType
Microsoft.AspNetCore.Razor.Test.Common.Tooling (4)
AssertExtensions.cs (4)
38foreach (var change in Flatten(changes)) 92static IEnumerable<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>> Flatten(SumType<TextDocumentEdit[], SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]> documentChanges) 103foreach (var change in changes)
Microsoft.CodeAnalysis.LanguageServer (2)
LanguageServer\Handler\CopilotCompletion\ContextResolveParam.cs (2)
26public Dictionary<string, SumType<string, int, bool, string[]>>? ActiveExperiments { get; set; } 43private static object UnpackSumType(SumType<string, int, bool, string[]> sumType)
Microsoft.CodeAnalysis.LanguageServer.Protocol (58)
Handler\CodeActions\CodeActionResolveHelper.cs (1)
47using var _1 = ArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>.GetInstance(out var textDocumentEdits);
Handler\Rename\WillRenameHandler.cs (2)
32using var _2 = ArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>.GetInstance(out var documentChangesBuilder); 67foreach (var sumType in sumTypes)
Protocol\Hover.cs (1)
23public SumType<string, MarkedString, SumType<string, MarkedString>[], MarkupContent> Contents { get; set; }
Protocol\Internal\VSInternalHover.cs (2)
33public new SumType<string, MarkedString, SumType<string, MarkedString>[], MarkupContent>? Contents 35get => contentsIsNull ? (SumType<string, MarkedString, SumType<string, MarkedString>[], MarkupContent>?)null : base.Contents;
Protocol\SumType.cs (51)
496internal struct SumType<T1, T2, T3, T4> : ISumType, IEquatable<SumType<T1, T2, T3, T4>> 511/// Initializes a new instance of the <see cref="SumType{T1, T2, T3, T4}"/> struct containing a <typeparamref name="T1"/>. 513/// <param name="val">The value to store in the <see cref="SumType{T1, T2, T3, T4}"/>.</param> 520/// Initializes a new instance of the <see cref="SumType{T1, T2, T3, T4}"/> struct containing a <typeparamref name="T2"/>. 522/// <param name="val">The value to store in the <see cref="SumType{T1, T2, T3, T4}"/>.</param> 529/// Initializes a new instance of the <see cref="SumType{T1, T2, T3, T4}"/> struct containing a <typeparamref name="T3"/>. 531/// <param name="val">The value to store in the <see cref="SumType{T1, T2, T3, T4}"/>.</param> 538/// Initializes a new instance of the <see cref="SumType{T1, T2, T3, T4}"/> struct containing a <typeparamref name="T4"/>. 540/// <param name="val">The value to store in the <see cref="SumType{T1, T2, T3, T4}"/>.</param> 570/// Implicitly wraps a value of type <typeparamref name="T1"/> with a <see cref="SumType{T1, T2, T3, T4}"/>. 573public static implicit operator SumType<T1, T2, T3, T4>(T1 val) => new(val); 576/// Implicitly wraps a value of type <typeparamref name="T1?"/> with a <see cref="SumType{T1, T2, T3, T4}"/>. 579public static implicit operator SumType<T1, T2, T3, T4>?(T1? val) => val is null ? null : new SumType<T1, T2, T3, T4>(val); 582/// Implicitly wraps a value of type <typeparamref name="T2"/> with a <see cref="SumType{T1, T2, T3, T4}"/>. 585public static implicit operator SumType<T1, T2, T3, T4>(T2 val) => new(val); 588/// Implicitly wraps a value of type <typeparamref name="T2?"/> with a <see cref="SumType{T1, T2, T3, T4}"/>. 591public static implicit operator SumType<T1, T2, T3, T4>?(T2? val) => val is null ? null : new SumType<T1, T2, T3, T4>(val); 594/// Implicitly wraps a value of type <typeparamref name="T3"/> with a <see cref="SumType{T1, T2, T3, T4}"/>. 597public static implicit operator SumType<T1, T2, T3, T4>(T3 val) => new(val); 600/// Implicitly wraps a value of type <typeparamref name="T3?"/> with a <see cref="SumType{T1, T2, T3, T4}"/>. 603public static implicit operator SumType<T1, T2, T3, T4>?(T3? val) => val is null ? null : new SumType<T1, T2, T3, T4>(val); 606/// Implicitly wraps a value of type <typeparamref name="T4"/> with a <see cref="SumType{T1, T2, T3, T4}"/>. 609public static implicit operator SumType<T1, T2, T3, T4>(T4 val) => new(val); 612/// Implicitly wraps a value of type <typeparamref name="T4?"/> with a <see cref="SumType{T1, T2, T3, T4}"/>. 615public static implicit operator SumType<T1, T2, T3, T4>?(T4? val) => val is null ? null : new SumType<T1, T2, T3, T4>(val); 618/// Implicitly wraps an instance of <see cref="SumType{A, B}"/> with a <see cref="SumType{T1, T2, T3, T4}"/>. 621public static implicit operator SumType<T1, T2, T3, T4>(SumType<T1, T2> sum) 627/// Implicitly wraps an instance of <see cref="SumType{T1, T2, T3}"/> with a <see cref="SumType{T1, T2, T3, T4}"/>. 630public static implicit operator SumType<T1, T2, T3, T4>(SumType<T1, T2, T3> sum) 637/// Attempts to cast an instance of <see cref="SumType{T1, T2, T3, T4}"/> into a <see cref="SumType{T1, T2}"/>. 640public static explicit operator SumType<T1, T2>(SumType<T1, T2, T3, T4> sum) 656/// Attempts to cast an instance of <see cref="SumType{T1, T2, T3, T4}"/> into a <see cref="SumType{T1, T2, T3}"/>. 659public static explicit operator SumType<T1, T2, T3>(SumType<T1, T2, T3, T4> sum) 680/// Attempts to cast an instance of <see cref="SumType{T1, T2, T3, T4}"/> to an instance of <typeparamref name="T1"/>. 682/// <exception cref="InvalidCastException">Thrown if this instance of <see cref="SumType{T1, T2, T3, T4}"/> does not contain an instance of <typeparamref name="T1"/>.</exception> 684public static explicit operator T1(SumType<T1, T2, T3, T4> sum) => sum.Value is T1 tVal ? tVal : throw new InvalidCastException(); 687/// Attempts to cast an instance of <see cref="SumType{T1, T2, T3, T4}"/> to an instance of <typeparamref name="T2"/>. 689/// <exception cref="InvalidCastException">Thrown if this instance of <see cref="SumType{T1, T2, T3, T4}"/> does not contain an instance of <typeparamref name="T2"/>.</exception> 691public static explicit operator T2(SumType<T1, T2, T3, T4> sum) => sum.Value is T2 tVal ? tVal : throw new InvalidCastException(); 694/// Attempts to cast an instance of <see cref="SumType{T1, T2, T3, T4}"/> to an instance of <typeparamref name="T3"/>. 696/// <exception cref="InvalidCastException">Thrown if this instance of <see cref="SumType{T1, T2, T3, T4}"/> does not contain an instance of <typeparamref name="T3"/>.</exception> 698public static explicit operator T3(SumType<T1, T2, T3, T4> sum) => sum.Value is T3 tVal ? tVal : throw new InvalidCastException(); 701/// Attempts to cast an instance of <see cref="SumType{T1, T2, T3, T4}"/> to an instance of <typeparamref name="T4"/>. 703/// <exception cref="InvalidCastException">Thrown if this instance of <see cref="SumType{T1, T2, T3, T4}"/> does not contain an instance of <typeparamref name="T4"/>.</exception> 705public static explicit operator T4(SumType<T1, T2, T3, T4> sum) => sum.Value is T4 tVal ? tVal : throw new InvalidCastException(); 707public static bool operator ==(SumType<T1, T2, T3, T4> left, SumType<T1, T2, T3, T4> right) 712public static bool operator !=(SumType<T1, T2, T3, T4> left, SumType<T1, T2, T3, T4> right) 853return obj is SumType<T1, T2, T3, T4> type && this.Equals(type); 857public bool Equals(SumType<T1, T2, T3, T4> other)
Protocol\WorkspaceEdit.cs (1)
42public SumType<TextDocumentEdit[], SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]>? DocumentChanges { get; set; }
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (4)
CodeActions\CodeActionResolveTests.cs (2)
357DocumentChanges = new SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[] 488DocumentChanges = new SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]
Rename\WillRenameTests.cs (2)
100DocumentChanges = new SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[] { 107listeners[1].Result = new WorkspaceEdit() { DocumentChanges = new SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[] { new RenameFile() { OldDocumentUri = new("file://file2.cs") } } };
Microsoft.CodeAnalysis.Razor.Workspaces (37)
CodeActions\CSharp\UnformattedRemappingCSharpCodeActionResolver.cs (1)
43var documentChanged = codeAction.Edit.DocumentChanges.Value.First();
CodeActions\Razor\CreateComponentCodeActionResolver.cs (2)
44using var documentChanges = new PooledArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>(); 55private static void TryAddNamespaceDirective(RazorCodeDocument codeDocument, Uri newComponentUri, ref PooledArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>> documentChanges)
CodeActions\Razor\ExtractToCodeBehindCodeActionResolver.cs (1)
59var documentChanges = new SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]
CodeActions\Razor\ExtractToComponentCodeActionResolver.cs (1)
81var documentChanges = new SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]
CodeActions\Razor\ExtractToCssCodeActionResolver.cs (1)
51using var changes = new PooledArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>(capacity: 3);
CodeActions\Razor\PromoteUsingCodeActionResolver.cs (1)
44using var edits = new PooledArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>();
CodeActions\Razor\WrapAttributesCodeActionResolver.cs (1)
48DocumentChanges = new SumType<TextDocumentEdit[], SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]>([tde])
DocumentMapping\RazorEditService_WorkspaceEdit.cs (2)
23using var builder = new PooledArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>(); 24foreach (var edit in workspaceEdit.EnumerateEdits())
Extensions\LspExtensions_SumTypes.cs (14)
12internal static int Count(this SumType<TextDocumentEdit[], SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]> sumType) 27internal static SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile> ElementAt(this SumType<TextDocumentEdit[], SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]> sumType, int elementIndex) 39return Assumed.Unreachable<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>(); 42internal static SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[] ToArray(this SumType<TextDocumentEdit[], SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]> sumType) 46return textDocumentEdit.Select(s => (SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>)s).ToArray(); 54return Assumed.Unreachable<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]>(); 57internal static SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile> First(this SumType<TextDocumentEdit[], SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]> sumType) 69return Assumed.Unreachable<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>(); 72internal static SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile> Last(this SumType<TextDocumentEdit[], SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]> sumType) 84return Assumed.Unreachable<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>();
Extensions\LspExtensions_WorkspaceEdit.cs (8)
29else if (workspaceEdit.DocumentChanges?.Value is SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[] sumTypeArray) 31foreach (var sumType in sumTypeArray) 41public static IEnumerable<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>> EnumerateEdits(this WorkspaceEdit workspaceEdit) 50else if (workspaceEdit.DocumentChanges?.Value is SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[] sumTypeArray) 52foreach (var edit in sumTypeArray) 66using var builder = new PooledArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>(); 76static void AddEdits(ref PooledArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>> builder, WorkspaceEdit edit) 85else if (edit.DocumentChanges?.Value is SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[] sumTypeArray)
Rename\RenameService.cs (5)
69using var documentChanges = new PooledArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>(); 76foreach (var documentChange in documentChanges) 99using var documentChanges = new PooledArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>(); 117ref PooledArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>> documentChanges, 125ref PooledArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>> documentChanges)
Microsoft.CodeAnalysis.Remote.Razor (1)
NestedFiles\RemoteAddNestedFileService.cs (1)
67var documentChanges = new SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]
Microsoft.VisualStudio.LanguageServices.Razor (2)
LanguageClient\Cohost\CohostApplyRenameEditEndpoint.cs (2)
69var documentChanges = new PooledArrayBuilder<SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>(); 74foreach (var edit in request.Edit.EnumerateEdits())