Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

New baselines for HtmlBlockTest#2609

Merged
ajaybhargavb merged 1 commit into
feature/razor-parserfrom
ajbaaska/htmlblocktest
Sep 26, 2018
Merged

New baselines for HtmlBlockTest#2609
ajaybhargavb merged 1 commit into
feature/razor-parserfrom
ajbaaska/htmlblocktest

Conversation

@ajaybhargavb
Copy link
Copy Markdown
Contributor

@ajaybhargavb ajaybhargavb commented Sep 25, 2018

Most of these tests call MarkupParser.ParseBlock() instead of MarkupParser.ParseDocument(). So these test a different code path in the HtmlParser. Basically it tests the html inside a csharp block.

Equals;[=];
MarkupTextLiteral - [14..15) - FullWidth: 1 - Gen<None> - SpanEditHandler;Accepts:Any
DoubleQuote;["];
GenericBlock - [15..16) - FullWidth: 1
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I case you are wondering, this is to address @NTaylorMullen's comment in earlier PR (What's the difference between HtmlBlock and HtmlMarkupBlock?). GenericBlock is basically a wrapper when we need some parent block. It doesn't have a syntactic significance.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Container?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's the word

SyntaxKind.ForwardSlash;[/];
SyntaxKind.Text;[text];
SyntaxKind.CloseAngle;[>];
MarkupBlock - [0..30) - FullWidth: 30 - [<text>Foo Bar <foo> Baz</text>]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

Equals;[=];
MarkupTextLiteral - [14..15) - FullWidth: 1 - Gen<None> - SpanEditHandler;Accepts:Any
DoubleQuote;["];
GenericBlock - [15..16) - FullWidth: 1
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Container?

Tag block - Gen<None> - 1 - (4:1,0)
Markup span - Gen<Markup> - [<] - SpanEditHandler;Accepts:Any - (4:1,0) - Tokens:1
SyntaxKind.OpenAngle;[<];
RazorDocument - [0..5) - FullWidth: 5 - [@{LF<]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Interesting, so only the first node in every file spits out the corresponding content? Hmmm

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. It spits out the entire content of the tree aka the input

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Might be valuable to spit out content of each tag block

Bang;[!];
DoubleHyphen;[--];
MarkupTextLiteral - [12..62) - FullWidth: 50 - Gen<Markup> - SpanEditHandler;Accepts:Whitespace
Whitespace;[ ];
Copy link
Copy Markdown

@NTaylorMullen NTaylorMullen Sep 25, 2018

Choose a reason for hiding this comment

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

Might be easier to read if you swap the order of these and add some space

[ ];  Whitespace;
[Hello,];  Text
[ ];  Whitespace;
[I];  Text;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought I'll keep the same ordering as before. I guess it might help to display the content of all *Literal nodes right next to it? Would that be helpful?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yup, read my mind 😉

SyntaxKind.Text;[foo];
SyntaxKind.Whitespace;[ ];
SyntaxKind.Text;[bar];
MarkupBlock - [0..9) - FullWidth: 9 - [@:foo bar]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Eventually we'll want to represent @: as its own node type to have a better understanding of the syntax tree. Something like SingleLineMarkupBlock

@ajaybhargavb
Copy link
Copy Markdown
Contributor Author

@rynowak I'm merging this now because of git related reasons. I'll address your feedback if any in a later PR.

@ajaybhargavb ajaybhargavb merged commit f85fd1d into feature/razor-parser Sep 26, 2018
@ajaybhargavb ajaybhargavb deleted the ajbaaska/htmlblocktest branch September 26, 2018 00:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants