Add AspNetCoreCSharpVirtualCharService#61673
Merged
CyrusNajmabadi merged 3 commits intomainfrom Jun 3, 2022
Merged
Conversation
JamesNK
commented
Jun 3, 2022
| } | ||
|
|
||
| /// <inheritdoc cref="CSharpVirtualCharService.Instance"/> | ||
| public static AspNetCoreCSharpVirtualCharService Instance => _instance; |
Member
Author
There was a problem hiding this comment.
This could be a field but a property gives more flexibility in case the underlying implementation needs to change.
JamesNK
commented
Jun 3, 2022
| public int Value => _virtualChar.Value; | ||
|
|
||
| /// <inheritdoc/> | ||
| public override string ToString() => _virtualChar.ToString(); |
Member
Author
There was a problem hiding this comment.
Adding this at the same time to make debugging a little easier.
| internal sealed class AspNetCoreCSharpVirtualCharService | ||
| { | ||
| private static readonly AspNetCoreCSharpVirtualCharService _instance = | ||
| new AspNetCoreCSharpVirtualCharService(CSharpVirtualCharService.Instance); |
Contributor
There was a problem hiding this comment.
i just want to check with @sharwell that this is ok. Specifically that an EA layer is linking directly to a C# layer value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Need to access virtual chars from more places than just classifier: also unit tests and analyzer.
PR removes virtual chars property from context and adds a static instance that can be used anywhere. It's ok that this is tied to CSharp as VB currently isn't a goal. If VB is desired then we can consider a more complicated approach in the future, but this type will still be useful for getting virtual chars in unit tests.