-
Notifications
You must be signed in to change notification settings - Fork 222
Conversation
Result = result; | ||
EditedNode = editedNode; | ||
} | ||
|
||
public EditResult(PartialParseResultInternal result, SpanBuilder editedSpan) |
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.
I missed removing this and there may be few other unused legacy methods. I'll remove those as part of cleanup.
protected virtual PartialParseResultInternal CanAcceptChange(Span target, SourceChange change) | ||
public virtual bool OwnsChange(Span target, SourceChange change) | ||
{ | ||
// Unused. Will be removed soon. |
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.
Will remove.
|
||
var annotation = node.GetAnnotations().FirstOrDefault(n => n.Kind == key); | ||
return annotation?.Data; | ||
} |
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.
Unrelated to partial parsing. This was causing an ambiguous reference.
|
||
namespace Microsoft.AspNetCore.Razor.Language.Syntax | ||
{ | ||
internal static class LegacySyntaxNodeExtensions |
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.
The knowledge of how the old Span
s relate to the new SyntaxNode
s live here.
@@ -91,6 +91,8 @@ public static bool IsTheory | |||
#endif | |||
} | |||
|
|||
protected int BaselineTestCount { get; set; } |
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.
I needed this to support the cases when we need to test multiple baselines within a single test
{ | ||
public class PartialParserTestBase : SyntaxNodeParserTestBase | ||
{ | ||
internal override BlockFactory CreateBlockFactory() |
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 will go away
factory.Code(Environment.NewLine).AsStatement(), | ||
factory.MetaCode("}").Accepts(AcceptedCharactersInternal.None)), | ||
factory.EmptyHtml())); | ||
VerifyPartialParseTree(manager, changed.GetText(), expectedCode); |
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 is an example of a test that has multiple baselines to test.
@@ -0,0 +1,19 @@ | |||
RazorDocument - [0..20)::20 - [foo @await Html. baz] |
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.
I've verified most of these tests manually. Should be enough to sanity check just a few.
c843716
to
ff1c073
Compare
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.
At this point we could probably run all of WTE's tests correct?
{ | ||
newTarget = Syntax.InternalSyntax.SyntaxFactory.UnclassifiedTextLiteral(builder.ToList()).CreateRed(target.Parent, target.Position); | ||
} | ||
|
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.
Should an else with a Debug.Fail for the unexpected scenario
throw new ArgumentNullException(nameof(node)); | ||
} | ||
|
||
var spanNodes = node.DescendantNodes().Where(n => n.IsSpanKind()); |
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.
Just ot make this semi-more performant change the logic to yield return because you bail out early a lot of the time in your previous/next methods.
Yup. I am working on it. |
#2700
This is the FINAL piece of the end-to-end puzzle. All tests in all Razor assemblies pass.
Up next,