Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

O# ExternalAccess: Provide InlineHint ranking to OmniSharp #69954

Merged
merged 3 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public static async Task<ImmutableArray<OmniSharpInlineHint>> GetInlineHintsAsyn
var hints = await service.GetInlineHintsAsync(document, textSpan, roslynOptions, displayAllOverride: false, cancellationToken).ConfigureAwait(false);
return hints.SelectAsArray(static h => new OmniSharpInlineHint(
h.Span,
h.Ranking,
h.DisplayParts,
h.ReplacementTextChange,
h.GetDescriptionAsync));
Expand All @@ -34,17 +35,20 @@ internal readonly struct OmniSharpInlineHint

public OmniSharpInlineHint(
TextSpan span,
double ranking,
ImmutableArray<TaggedText> displayParts,
TextChange? replacementTextChange,
Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>> getDescriptionAsync)
{
Span = span;
Ranking = ranking;
DisplayParts = displayParts;
ReplacementTextChange = replacementTextChange;
_getDescriptionAsync = getDescriptionAsync;
}

public readonly TextSpan Span { get; }
public readonly double Ranking { get; }
public readonly ImmutableArray<TaggedText> DisplayParts { get; }
public readonly TextChange? ReplacementTextChange { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.InlineHints.OmniSharpInlineHint
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.InlineHints.OmniSharpInlineHint.DisplayParts.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.TaggedText>
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.InlineHints.OmniSharpInlineHint.GetDescriptionAsync(Microsoft.CodeAnalysis.Document! document, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.TaggedText>>!
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.InlineHints.OmniSharpInlineHint.OmniSharpInlineHint() -> void
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.InlineHints.OmniSharpInlineHint.OmniSharpInlineHint(Microsoft.CodeAnalysis.Text.TextSpan span, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.TaggedText> displayParts, Microsoft.CodeAnalysis.Text.TextChange? replacementTextChange, System.Func<Microsoft.CodeAnalysis.Document!, System.Threading.CancellationToken, System.Threading.Tasks.Task<System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.TaggedText>>!>! getDescriptionAsync) -> void
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.InlineHints.OmniSharpInlineHint.OmniSharpInlineHint(Microsoft.CodeAnalysis.Text.TextSpan span, double ranking, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.TaggedText> displayParts, Microsoft.CodeAnalysis.Text.TextChange? replacementTextChange, System.Func<Microsoft.CodeAnalysis.Document!, System.Threading.CancellationToken, System.Threading.Tasks.Task<System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.TaggedText>>!>! getDescriptionAsync) -> void
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.InlineHints.OmniSharpInlineHint.Ranking.get -> double
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.InlineHints.OmniSharpInlineHint.ReplacementTextChange.get -> Microsoft.CodeAnalysis.Text.TextChange?
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.InlineHints.OmniSharpInlineHint.Span.get -> Microsoft.CodeAnalysis.Text.TextSpan
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.InlineHints.OmniSharpInlineHintsOptions
Expand Down