Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

Supplants the existing EditorFEatures api UnitTestingReferencesService. Once we get unit testing onto this new api, we can remove that old api and remove their dependency on EditorFEatures.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner April 16, 2025 21:03
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 16, 2025
{
Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync(
Guid projectGuid, string filePath, TextSpan span, DocumentId? sourceGeneratedDocumentId, CancellationToken cancellationToken);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing you need to worry about @shyamnamboodiripad This just gives us a strong api signature between this code here and the impl on the vs side.

internal interface IUnitTestingFeaturesReferencesServiceCallback
{
Task<TResult> InvokeAsync<TResult>(string targetName, IReadOnlyList<object?> arguments, CancellationToken cancellationToken);
}
Copy link
Member Author

@CyrusNajmabadi CyrusNajmabadi Apr 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shyam you'll provide an impl of this on your side. it will be implemented as:

class YourImpl(
    IAsyncCodeLensDataPointProvider provider,
    ICodeLensCallbackService callbackService) : IUnitTestingFeaturesReferencesServiceCallback
{
    public Task<TResult> InvokeAsync<TResult>(string targetName, IReadOnlyList<object?> arguments, CancellationToken cancellationToken) => callbackService.InvokeAsync(targetName, arguments, cancellationToken);
}

TextSpan span,
DocumentId? sourceGeneratedDocumentId,
IUnitTestingFeaturesReferencesServiceCallback callback,
CancellationToken cancellationToken)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this api is much lower than the prior Editor level api. So it doesn't talk about vs codelens concepts. It just talks about data, and just passes in an abstraction for the call to be made back to VS through the 'callback' parameter which hides all the codelens stuff as well.

@CyrusNajmabadi
Copy link
Member Author

@dibarbet ptal


internal static class CodeLensHelpers
{
public static DocumentId? GetSourceGeneratorDocumentId(IDictionary<object, object> descriptorProperties)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved from later code. used by us, and then also exposed through EA for UnitTesting to use.

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants