-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Adding new EA api at 'Features' layer for unit testing ot use #78175
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
Conversation
| { | ||
| Task<ImmutableArray<ReferenceMethodDescriptor>?> FindReferenceMethodsAsync( | ||
| Guid projectGuid, string filePath, TextSpan span, DocumentId? sourceGeneratedDocumentId, CancellationToken cancellationToken); | ||
| } |
There was a problem hiding this comment.
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); | ||
| } |
There was a problem hiding this comment.
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);
}
src/Features/Core/Portable/ExternalAccess/UnitTesting/UnitTestingFeaturesReferencesService.cs
Show resolved
Hide resolved
| TextSpan span, | ||
| DocumentId? sourceGeneratedDocumentId, | ||
| IUnitTestingFeaturesReferencesServiceCallback callback, | ||
| CancellationToken cancellationToken) |
There was a problem hiding this comment.
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.
|
@dibarbet ptal |
|
|
||
| internal static class CodeLensHelpers | ||
| { | ||
| public static DocumentId? GetSourceGeneratorDocumentId(IDictionary<object, object> descriptorProperties) |
There was a problem hiding this comment.
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.
ToddGrun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
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.