New baselines for RazorDirectivesTest#2621
Conversation
| @@ -1,7 +1,7 @@ | |||
| Markup span at (0:0,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [26] ) | |||
| Code span at (2:1,0 [2] ) (Accepts:Any) - Parent: Directive block at (2:1,0 [24] ) | |||
There was a problem hiding this comment.
Can I fight for this? I don't get why the whitespace prior to a directive needs to be part of the directive. The way I designed it, the directive starts with a transition@.
There was a problem hiding this comment.
How do you plan to implement trivia for directives? In my mind the leading whitespace of a directive should have the following characteristics:
- Cannot contain any content
- Should have 0 intellisense/completion at design time
- Can be 0+ whitespace characters long.
With whatever trivia approach you have in mind would it make the above characteristics easy to implement/understand?
There was a problem hiding this comment.
From what I understand from Roslyn, "trivia" is generally associated with tokens rather than specific nodes. Leading trivia of any node is basically the leading trivia of its first token. https://github.com/dotnet/roslyn/blob/master/src/Compilers/Core/Portable/Syntax/SyntaxNode.cs#L911.
It does make sense to have the leading whitespace as the leading trivia for the transition @. But don't we already allow comments before the start of a directive? Not sure if it makes sense to have that as part of trivia. Having said that, I haven't given a lot of thought to how we want to do trivia yet. So, this might need more discussion.
There was a problem hiding this comment.
There was a problem hiding this comment.
Spoke to @NTaylorMullen offline. We are not going to make this consistent with the old world because the old world already has different behavior depending on the contents of the previous line. I plan to keep this change and test this in the editor to make sure we didn't break anything.
| @@ -1,7 +1,7 @@ | |||
| Markup span at (0:0,0 [2] ) (Accepts:Any) - Parent: Markup block at (0:0,0 [46] ) | |||
| Code span at (2:1,0 [2] ) (Accepts:Any) - Parent: Directive block at (2:1,0 [44] ) | |||
| Identifier;[Encoding]; | ||
| Dot;[.]; | ||
| Identifier;[ASCIIEncoding]; | ||
| MarkupEphemeralTextLiteral - [42..44)::2 - [LF] - Gen<None> - SpanEditHandler;Accepts:Whitespace |
There was a problem hiding this comment.
I see this and I lol? What is this?
There was a problem hiding this comment.
Naming is hard! I had originally named it MarkupHiddenTextLiteral. This is basically content that is necessary for design time but we don't want them rendered in output.
There was a problem hiding this comment.
It seems like I have a lot to learn
e3517b0 to
15426c7
Compare
5148739 to
9a862c6
Compare
15426c7 to
1b25ad9
Compare
| CSharpTransition - [0..1)::1 - Gen<None> - SpanEditHandler;Accepts:None | ||
| Transition;[@]; | ||
| RazorDirectiveBody - [1..17)::16 | ||
| RazorMetaCode - [1..13)::12 - Gen<None> - SpanEditHandler;Accepts:None |
There was a problem hiding this comment.
Might eventually make sense to lift this outside of the directive body since it represents the directive identifier.
There was a problem hiding this comment.
| CSharpStatementLiteral - [8..15)::7 - [string?] - Gen<DirectiveToken {;Type;Opt:False}> - DirectiveTokenEditHandler;Accepts:NonWhitespace | ||
| Keyword;[string]; | ||
| QuestionMark;[?]; | ||
| CSharpStatementLiteral - [15..16)::1 - [ ] - Gen<None> - SpanEditHandler;Accepts:Whitespace |
There was a problem hiding this comment.
Ya we'll also eventually want to change these whitespace markers to be a different type of significant
There was a problem hiding this comment.
| MarkupBlock - [0..19)::19 | ||
| MarkupTextLiteral - [0..0)::0 - [] - Gen<Markup> - SpanEditHandler;Accepts:Any | ||
| Marker;[]; | ||
| CSharpCodeBlock - [0..19)::19 |
There was a problem hiding this comment.
Still hate that we wrap things like this in code blocks but it's something we'll probably never change

Another file with lots of tests