Merged
Conversation
47c1cbc to
665ca58
Compare
333fred
commented
Feb 9, 2023
|
|
||
| public Func<string, IEnumerable<Syntax.InternalSyntax.SyntaxToken>> Tokenizer { get; set; } | ||
|
|
||
| public static SpanEditHandler CreateDefault() |
Member
Author
There was a problem hiding this comment.
When refactoring, I found the implicit AcceptedCharactersInternal values confusing, so I removed this overload.
333fred
commented
Feb 9, 2023
| public required bool AutoCompleteAtEndOfSpan { get; init; } | ||
|
|
||
| public string AutoCompleteString { get; set; } | ||
| public string AutoCompleteString => _autoCompleteStringAccessor.CanAcceptCloseBrace ? "}" : null; |
Member
Author
There was a problem hiding this comment.
This is the only place where we were using the mutation capabilities of contexts, and it was really just delayed initialization. I've replaced it with an accessor that verifies only one set occurs, and verifies that the set occurred before access.
7555723 to
7ba0da4
Compare
Member
Author
|
@dotnet/razor-compiler for review please. |
jaredpar
reviewed
Feb 13, 2023
| public string AssemblyName { get; set; } | ||
| public string AssemblyName { get; } | ||
|
|
||
| public List<RazorDiagnostic> Diagnostics { get; } |
Member
There was a problem hiding this comment.
Is the expectation that this becomes ImmutableArray<ReportDiagnostic> in the future?
Member
Author
There was a problem hiding this comment.
My expectation is that this gets removed entirely at some point 🙂.
src/Compiler/Microsoft.AspNetCore.Razor.Language/src/DirectiveTokenEditHandler.cs
Outdated
Show resolved
Hide resolved
src/Compiler/Microsoft.AspNetCore.Razor.Language/src/Legacy/SpanEditHandlerBuilder.cs
Outdated
Show resolved
Hide resolved
chsienki
reviewed
Feb 15, 2023
src/Compiler/Microsoft.AspNetCore.Razor.Language/src/Legacy/CSharpCodeParser.cs
Show resolved
Hide resolved
chsienki
reviewed
Feb 15, 2023
src/Compiler/Microsoft.AspNetCore.Razor.Language/src/Legacy/SpanEditHandlerBuilder.cs
Show resolved
Hide resolved
chsienki
reviewed
Feb 15, 2023
src/Compiler/Microsoft.AspNetCore.Razor.Language/src/Legacy/SpanEditHandlerBuilder.cs
Show resolved
Hide resolved
jjonescz
approved these changes
Feb 16, 2023
a591e1d to
b6d0d0a
Compare
...enerator.Tooling.Internal/Microsoft.AspNetCore.Razor.SourceGenerator.Tooling.Internal.csproj
Outdated
Show resolved
Hide resolved
Only one context needs a bit of delayed initialization, the AutoComplete context, as it needs to know whether or not to accept a closing brace during partial reparsing. Aside from this single instance, all other contexts were used completely immutably, and now reflect this.
b6d0d0a to
c1c17fc
Compare
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.
Makes all span contexts fully immutable, and converts to a builder pattern for creating them during parsing.