8 instantiations of SumType
Microsoft.CodeAnalysis.LanguageServer.Protocol (8)
Handler\CodeActions\CodeActionResolveHelper.cs (1)
289var edits = textChanges.Select(tc => new LSP.SumType<LSP.TextEdit, LSP.AnnotatedTextEdit>(ProtocolConversions.TextChangeToTextEdit(tc, oldText))).ToArray();
Handler\Diagnostics\Public\PublicWorkspacePullDiagnosticsHandler.cs (2)
40=> new(new WorkspaceDiagnosticReport 56=> new(new WorkspaceDiagnosticReport
Handler\Symbols\WorkspaceSymbolsHandler.cs (1)
58(SymbolInformation[] t) => new SumType<SymbolInformation[], WorkspaceSymbol[]>(t));
Protocol\SumType.cs (4)
65public static implicit operator SumType<T1, T2>(T1 val) => new SumType<T1, T2>(val); 71public static implicit operator SumType<T1, T2>?(T1? val) => val is null ? null : new SumType<T1, T2>(val); 77public static implicit operator SumType<T1, T2>(T2 val) => new SumType<T1, T2>(val); 83public static implicit operator SumType<T1, T2>?(T2? val) => val is null ? null : new SumType<T1, T2>(val);
141 references to SumType
Microsoft.CodeAnalysis.LanguageServer.Protocol (139)
Handler\Diagnostics\Public\PublicDocumentPullDiagnosticsHandler.cs (3)
18using DocumentDiagnosticReport = SumType<RelatedFullDocumentDiagnosticReport, RelatedUnchangedDocumentDiagnosticReport>; 21internal sealed partial class PublicDocumentPullDiagnosticsHandler : AbstractDocumentPullDiagnosticHandler<DocumentDiagnosticParams, DocumentDiagnosticPartialReport, DocumentDiagnosticReport?> 65protected override DocumentDiagnosticReport? CreateReturn(BufferedProgress<DocumentDiagnosticPartialReport> progress)
Handler\Diagnostics\Public\PublicWorkspacePullDiagnosticsHandler.cs (6)
20using WorkspaceDiagnosticPartialReport = SumType<WorkspaceDiagnosticReport, WorkspaceDiagnosticReportPartialResult>; 23internal sealed partial class PublicWorkspacePullDiagnosticsHandler : AbstractWorkspacePullDiagnosticsHandler<WorkspaceDiagnosticParams, WorkspaceDiagnosticPartialReport, WorkspaceDiagnosticReport?>, IDisposable 39protected override WorkspaceDiagnosticPartialReport CreateReport(TextDocumentIdentifier identifier, Roslyn.LanguageServer.Protocol.Diagnostic[] diagnostics, string resultId) 55protected override WorkspaceDiagnosticPartialReport CreateRemovedReport(TextDocumentIdentifier identifier) 71protected override bool TryCreateUnchangedReport(TextDocumentIdentifier identifier, string resultId, out WorkspaceDiagnosticPartialReport report) 79protected override WorkspaceDiagnosticReport? CreateReturn(BufferedProgress<WorkspaceDiagnosticPartialReport> progress)
Handler\Hover\HoverHandler.cs (1)
124Contents = new SumType<string, MarkedString, SumType<string, MarkedString>[], MarkupContent>(string.Empty),
Handler\References\FindAllReferencesHandler.cs (2)
25internal sealed class FindAllReferencesHandler : ILspServiceDocumentRequestHandler<VSInternalReferenceParams, LSP.SumType<VSInternalReferenceItem, LSP.Location>[]?> 48public async Task<LSP.SumType<VSInternalReferenceItem, LSP.Location>[]?> HandleRequestAsync(
Handler\References\FindUsagesLSPContext.cs (9)
32private readonly IProgress<SumType<VSInternalReferenceItem, LSP.Location>[]> _progress; 53private readonly Dictionary<int, SumType<VSInternalReferenceItem, LSP.Location>> _definitionsWithoutReference = []; 70private readonly AsyncBatchingWorkQueue<SumType<VSInternalReferenceItem, LSP.Location>> _workQueue; 76IProgress<SumType<VSInternalReferenceItem, LSP.Location>[]> progress, 93_workQueue = new AsyncBatchingWorkQueue<SumType<VSInternalReferenceItem, LSP.Location>>( 156if (_definitionsWithoutReference.TryGetValue(definitionId, out var definition)) 177private async Task<SumType<VSInternalReferenceItem, LSP.Location>?> GenerateVSReferenceItemAsync( 201private static SumType<VSInternalReferenceItem, LSP.Location>? CreateVsReference( 367private ValueTask ReportReferencesAsync(ImmutableSegmentedList<SumType<VSInternalReferenceItem, LSP.Location>> referencesToReport, CancellationToken cancellationToken)
Handler\Symbols\DocumentSymbolsHandler.cs (3)
28internal sealed class DocumentSymbolsHandler : ILspServiceDocumentRequestHandler<RoslynDocumentSymbolParams, SumType<DocumentSymbol[], SymbolInformation[]>> 41public Task<SumType<DocumentSymbol[], SymbolInformation[]>> HandleRequestAsync( 52internal static async Task<SumType<DocumentSymbol[], SymbolInformation[]>> GetDocumentSymbolsAsync(
Handler\Symbols\WorkspaceSymbolsHandler.cs (2)
28: ILspServiceRequestHandler<WorkspaceSymbolParams, SumType<SymbolInformation[], WorkspaceSymbol[]>?> 50public async Task<SumType<SymbolInformation[], WorkspaceSymbol[]>?> HandleRequestAsync(WorkspaceSymbolParams request, RequestContext context, CancellationToken cancellationToken)
Protocol\CodeActionParams.cs (2)
16internal class CodeActionParams : ITextDocumentParams, IWorkDoneProgressParams, IPartialResultParams<SumType<Command, CodeAction>[]> 59public IProgress<SumType<Command, CodeAction>[]>? PartialResultToken { get; set; }
Protocol\CompletionItem.cs (2)
95public SumType<string, MarkupContent>? Documentation 227public SumType<TextEdit, InsertReplaceEdit>? TextEdit
Protocol\CompletionListItemDefaults.cs (1)
32public SumType<Range, InsertReplaceRange>? EditRange
Protocol\CompletionParams.cs (2)
16internal class CompletionParams : TextDocumentPositionParams, IPartialResultParams<SumType<CompletionItem[], CompletionList>?>, IWorkDoneProgressOptions 33public IProgress<SumType<CompletionItem[], CompletionList>?>? PartialResultToken
Protocol\Converters\ParameterInformationConverter.cs (2)
31parameter.Label = labelElement.Deserialize<SumType<string, Tuple<int, int>>>(options); 37parameter.Documentation = documentationElement.Deserialize<SumType<string, MarkupContent>>(options);
Protocol\Diagnostic.cs (1)
48public SumType<int, string>? Code
Protocol\DocumentDiagnosticReportPartialResult.cs (1)
24public Dictionary<Uri, SumType<FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport>> RelatedDocuments
Protocol\DocumentSymbolParams.cs (2)
19IPartialResultParams<SumType<SymbolInformation[], DocumentSymbol[]>> 41public IProgress<SumType<SymbolInformation[], DocumentSymbol[]>>? PartialResultToken { get; set; }
Protocol\FileOperations\FileSystemWatcher.cs (1)
24public SumType<string, RelativePattern> GlobPattern { get; init; }
Protocol\FileOperations\RelativePattern.cs (1)
24public SumType<WorkspaceFolder, Uri> BaseUri { get; init; }
Protocol\FileOperations\WorkspaceFoldersServerCapabilities.cs (1)
37public SumType<string, bool>? ChangeNotifications { get; init; }
Protocol\Hover.cs (1)
23public SumType<string, MarkedString, SumType<string, MarkedString>[], MarkupContent> Contents { get; set; }
Protocol\InlayHint.cs (2)
42public SumType<string, InlayHintLabelPart[]> Label 89public SumType<string, MarkupContent>? ToolTip
Protocol\InlayHintLabelPart.cs (1)
37public SumType<string, MarkupContent>? ToolTip
Protocol\Internal\VSInternalCompletionItem.cs (1)
44public SumType<string[], VSInternalCommitCharacter[]>? VsCommitCharacters { get; set; }
Protocol\Internal\VSInternalCompletionList.cs (1)
60public SumType<string[], VSInternalCommitCharacter[]>? CommitCharacters { 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\Internal\VSInternalReferenceParams.cs (2)
13internal class VSInternalReferenceParams : ReferenceParams, IPartialResultParams<SumType<VSInternalReferenceItem, Location>[]> 30public new IProgress<SumType<VSInternalReferenceItem, Location>[]>? PartialResultToken { get; set; }
Protocol\Methods.Document.cs (4)
148public static readonly LspRequest<DocumentSymbolParams, SumType<SymbolInformation[], DocumentSymbol[]>?> TextDocumentDocumentSymbol = new(TextDocumentDocumentSymbolName); 200public static readonly LspRequest<SemanticTokensDeltaParams, SumType<SemanticTokens, SemanticTokensDelta>?> TextDocumentSemanticTokensFullDelta = new(TextDocumentSemanticTokensFullDeltaName); 386public static readonly LspRequest<CompletionParams, SumType<CompletionItem[], CompletionList>?> TextDocumentCompletion = new(TextDocumentCompletionName); 436public static readonly LspRequest<CodeActionParams, SumType<Command, CodeAction>[]?> TextDocumentCodeAction = new(TextDocumentCodeActionName);
Protocol\Methods.Workspace.cs (1)
27public static readonly LspRequest<WorkspaceSymbolParams, SumType<SymbolInformation[], WorkspaceSymbol[]>?> WorkspaceSymbol = new(WorkspaceSymbolName);
Protocol\Navigation\DeclarationParams.cs (2)
16internal class DeclarationParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialResultParams<SumType<Location[], LocationLink[]>> 29public IProgress<SumType<Location[], LocationLink[]>>? PartialResultToken { get; set; }
Protocol\Navigation\DefinitionParams.cs (2)
16internal class DefinitionParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialResultParams<SumType<Location[], LocationLink[]>> 29public IProgress<SumType<Location[], LocationLink[]>>? PartialResultToken { get; set; }
Protocol\Navigation\ImplementationParams.cs (2)
16internal class ImplementationParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialResultParams<SumType<Location[], LocationLink[]>> 29public IProgress<SumType<Location[], LocationLink[]>>? PartialResultToken { get; set; }
Protocol\Navigation\TypeDefinitionParams.cs (2)
16internal class TypeDefinitionParams : TextDocumentPositionParams, IWorkDoneProgressParams, IPartialResultParams<SumType<Location[], LocationLink[]>> 29public IProgress<SumType<Location[], LocationLink[]>>? PartialResultToken { get; set; }
Protocol\Notebook\NotebookCellTextDocumentFilter.cs (1)
26public SumType<string, NotebookDocumentFilter> Notebook { get; init; }
Protocol\Notebook\NotebookDocumentSyncSelector.cs (1)
28public SumType<string, NotebookDocumentFilter>? Notebook { get; init; }
Protocol\ParameterInformation.cs (2)
35public SumType<string, Tuple<int, int>> Label 46public SumType<string, MarkupContent>? Documentation
Protocol\RelatedFullDocumentDiagnosticReport.cs (1)
32public Dictionary<Uri, SumType<FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport>>? RelatedDocuments
Protocol\RelatedUnchangedDocumentDiagnosticReport.cs (1)
32public Dictionary<Uri, SumType<FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport>>? RelatedDocuments
Protocol\SemanticTokens\SemanticTokensOptions.cs (2)
30public SumType<bool, object>? Range { get; set; } 37public SumType<bool, SemanticTokensFullOptions>? Full { get; set; }
Protocol\SemanticTokens\SemanticTokensRequestsSetting.cs (2)
24public SumType<bool, object>? Range { get; set; } 32public SumType<bool, SemanticTokensRequestsFullSetting>? Full { get; set; }
Protocol\ServerCapabilities.cs (15)
61public SumType<NotebookDocumentSyncOptions, NotebookDocumentSyncRegistrationOptions>? NotebookDocumentSync { get; init; } 75public SumType<bool, HoverOptions>? HoverProvider { get; set; } 97public SumType<bool, DefinitionOptions>? DefinitionProvider { get; set; } 120public SumType<bool, ReferenceOptions>? ReferencesProvider { get; set; } 127public SumType<bool, DocumentHighlightOptions>? DocumentHighlightProvider { get; set; } 134public SumType<bool, DocumentSymbolOptions>? DocumentSymbolProvider { get; set; } 143public SumType<bool, CodeActionOptions>? CodeActionProvider { get; set; } 172public SumType<bool, DocumentFormattingOptions>? DocumentFormattingProvider { get; set; } 179public SumType<bool, DocumentRangeFormattingOptions>? DocumentRangeFormattingProvider { get; set; } 193public SumType<bool, RenameOptions>? RenameProvider { get; set; } 201public SumType<bool, FoldingRangeOptions>? FoldingRangeProvider { get; set; } 224public SumType<bool, LinkedEditingRangeOptions>? LinkedEditingRangeProvider { get; set; } 240public SumType<SemanticTokensOptions, SemanticTokensRegistrationOptions>? SemanticTokensOptions { get; set; } 280public SumType<DiagnosticOptions, DiagnosticRegistrationOptions>? DiagnosticOptions { get; set; } 287public SumType<bool, WorkspaceSymbolOptions>? WorkspaceSymbolProvider { get; set; }
Protocol\SignatureInformation.cs (1)
33public SumType<string, MarkupContent>? Documentation
Protocol\SumType.cs (36)
20internal struct SumType<T1, T2> : ISumType, IEquatable<SumType<T1, T2>> 31/// Initializes a new instance of the <see cref="SumType{T1, T2}"/> struct containing a <typeparamref name="T1"/>. 33/// <param name="val">The value to store in the <see cref="SumType{T1, T2}"/>.</param> 40/// Initializes a new instance of the <see cref="SumType{T1, T2}"/> struct containing a <typeparamref name="T2"/>. 42/// <param name="val">The value to store in the <see cref="SumType{T1, T2}"/>.</param> 62/// Implicitly wraps a value of type <typeparamref name="T1"/> with a <see cref="SumType{T1, T2}"/>. 65public static implicit operator SumType<T1, T2>(T1 val) => new SumType<T1, T2>(val); 68/// Implicitly wraps a value of type <typeparamref name="T1?"/> with a <see cref="SumType{T1, T2}"/>. 71public static implicit operator SumType<T1, T2>?(T1? val) => val is null ? null : new SumType<T1, T2>(val); 74/// Implicitly wraps a value of type <typeparamref name="T2"/> with a <see cref="SumType{T1, T2}"/>. 77public static implicit operator SumType<T1, T2>(T2 val) => new SumType<T1, T2>(val); 80/// Implicitly wraps a value of type <typeparamref name="T2?"/> with a <see cref="SumType{T1, T2}"/>. 83public static implicit operator SumType<T1, T2>?(T2? val) => val is null ? null : new SumType<T1, T2>(val); 86/// Attempts to cast an instance of <see cref="SumType{T1, T2}"/> to an instance of <typeparamref name="T1"/>. 88/// <exception cref="InvalidCastException">Thrown if this instance of <see cref="SumType{T1, T2}"/> does not contain an instance of <typeparamref name="T1"/>.</exception> 90public static explicit operator T1(SumType<T1, T2> sum) => sum.Value is T1 tVal ? tVal : throw new InvalidCastException(); 93/// Attempts to cast an instance of <see cref="SumType{T1, T2}"/> to an instance of <typeparamref name="T2"/>. 95/// <exception cref="InvalidCastException">Thrown if this instance of <see cref="SumType{T1, T2}"/> does not contain an instance of <typeparamref name="T2"/>.</exception> 97public static explicit operator T2(SumType<T1, T2> sum) => sum.Value is T2 tVal ? tVal : throw new InvalidCastException(); 99public static bool operator ==(SumType<T1, T2> left, SumType<T1, T2> right) 104public static bool operator !=(SumType<T1, T2> left, SumType<T1, T2> right) 189return obj is SumType<T1, T2> type && this.Equals(type); 193public bool Equals(SumType<T1, T2> other) 306/// Implicitly wraps an instance of <see cref="SumType{T1, T2}"/> with a <see cref="SumType{T1, T2, T3}"/>. 309public static implicit operator SumType<T1, T2, T3>(SumType<T1, T2> sum) 315/// Attempts to cast an instance of <see cref="SumType{T1, T2, T3}"/> into a <see cref="SumType{T1, T2}"/>. 318public static explicit operator SumType<T1, T2>(SumType<T1, T2, T3> sum) 341/// Attempts to cast an instance of <see cref="SumType{T1, T2}"/> to an instance of <typeparamref name="T2"/>. 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) 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) 888public static TCommon Unify<TCommon, TDerived>(this SumType<TCommon, TDerived> sumType) 893public static TCommon[] Unify<TCommon, TDerived>(this SumType<TCommon[], TDerived[]> sumType)
Protocol\TextDocumentEdit.cs (1)
39public SumType<TextEdit, AnnotatedTextEdit>[] Edits { get; set; }
Protocol\TextDocumentSyncOptions.cs (1)
67public SumType<bool, SaveOptions>? Save
Protocol\WorkDoneProgressCancelParams.cs (1)
23public SumType<int, string> Token { get; init; }
Protocol\WorkDoneProgressCreateParams.cs (1)
23public SumType<int, string> Token { get; init; }
Protocol\WorkspaceDiagnosticParams.cs (2)
19internal class WorkspaceDiagnosticParams : IWorkDoneProgressParams, IPartialResultParams<SumType<WorkspaceDiagnosticReport, WorkspaceDiagnosticReportPartialResult>> 31public IProgress<SumType<WorkspaceDiagnosticReport, WorkspaceDiagnosticReportPartialResult>>? PartialResultToken { get; set; }
Protocol\WorkspaceDiagnosticReport.cs (1)
22public SumType<WorkspaceFullDocumentDiagnosticReport, WorkspaceUnchangedDocumentDiagnosticReport>[] Items
Protocol\WorkspaceDiagnosticReportPartialResult.cs (1)
22public SumType<WorkspaceFullDocumentDiagnosticReport, WorkspaceUnchangedDocumentDiagnosticReport>[] Items
Protocol\WorkspaceEdit.cs (1)
42public SumType<TextDocumentEdit[], SumType<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>[]>? DocumentChanges { get; set; }
Protocol\WorkspaceSymbol.cs (1)
57public SumType<Location, WorkspaceSymbolLocation> Location { get; init; }
Protocol\WorkspaceSymbolParams.cs (2)
18: IPartialResultParams<SumType<SymbolInformation[], WorkspaceSymbol[]>>, IWorkDoneProgressParams 32public IProgress<SumType<SymbolInformation[], WorkspaceSymbol[]>>? PartialResultToken { get; set; }
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Diagnostics\AbstractPullDiagnosticTestsBase.cs (2)
122BufferedProgress<WorkspaceDiagnosticPartialReport>? progress = useProgress ? BufferedProgress.Create<WorkspaceDiagnosticPartialReport>(null) : null;