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)
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\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)