Skip to content

Conversation

@TanayParikh
Copy link
Contributor

Fixes: #33602

$ diff -b ComponentWithTypeParameters/TestComponent.codegen.cs ComponentWithTypeParameters_WithSemicolon/TestComponent.codegen.cs 
50,51c50,51
< #line 6 "x:\dir\subdir\Test\TestComponent.cshtml"
<  foreach (var item2 in Items2)
---
> #line 5 "x:\dir\subdir\Test\TestComponent.cshtml"
> foreach (var item2 in Items2)



$ diff -b ComponentWithTypeParameters/TestComponent.codegen.cs ComponentWithTypeParameters_WithSemicolon/TestComponent.codegen.cs 
50,51c50,51
< #line 6 "x:\dir\subdir\Test\TestComponent.cshtml"
<  foreach (var item2 in Items2)
---
> #line 5 "x:\dir\subdir\Test\TestComponent.cshtml"
> foreach (var item2 in Items2)

diff -br ComponentWithTypeParameters/ ComponentWithTypeParameters_WithSemicolon/

Details
diff -br ComponentWithTypeParameters/TestComponent.codegen.cs ComponentWithTypeParameters_WithSemicolon/TestComponent.codegen.cs
50,51c50,51
< #line 6 "x:\dir\subdir\Test\TestComponent.cshtml"
<  foreach (var item2 in Items2)
---
> #line 5 "x:\dir\subdir\Test\TestComponent.cshtml"
> foreach (var item2 in Items2)
diff -br ComponentWithTypeParameters/TestComponent.ir.txt ComponentWithTypeParameters_WithSemicolon/TestComponent.ir.txt
11c11
<                 DirectiveToken - (71:2,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) - TItem2
---
>                 DirectiveToken - (71:2,10 [6] x:\dir\subdir\Test\TestComponent.cshtml) - TItem2
21,42c21,42
<                 HtmlContent - (79:3,0 [2] x:\dir\subdir\Test\TestComponent.cshtml)
<                     LazyIntermediateToken - (79:3,0 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
<                 MarkupElement - (81:4,0 [14] x:\dir\subdir\Test\TestComponent.cshtml) - h1
<                     HtmlContent - (85:4,4 [5] x:\dir\subdir\Test\TestComponent.cshtml)
<                         LazyIntermediateToken - (85:4,4 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Item1
<                 HtmlContent - (95:4,14 [2] x:\dir\subdir\Test\TestComponent.cshtml)
<                     LazyIntermediateToken - (95:4,14 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
<                 CSharpCode - (98:5,1 [38] x:\dir\subdir\Test\TestComponent.cshtml)
<                     LazyIntermediateToken - (98:5,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - foreach (var item2 in Items2)\n{\n    
<                 MarkupElement - (136:7,4 [40] x:\dir\subdir\Test\TestComponent.cshtml) - p
<                     HtmlContent - (139:7,7 [6] x:\dir\subdir\Test\TestComponent.cshtml)
<                         LazyIntermediateToken - (139:7,7 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n    
<                     CSharpExpression - (146:8,5 [19] x:\dir\subdir\Test\TestComponent.cshtml)
<                         LazyIntermediateToken - (146:8,5 [19] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ChildContent(item2)
<                     HtmlContent - (165:8,24 [7] x:\dir\subdir\Test\TestComponent.cshtml)
<                         LazyIntermediateToken - (165:8,24 [7] x:\dir\subdir\Test\TestComponent.cshtml) - Html - ;\n    
<                 CSharpCode - (176:9,8 [3] x:\dir\subdir\Test\TestComponent.cshtml)
<                     LazyIntermediateToken - (176:9,8 [3] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n}
<                 HtmlContent - (179:10,1 [2] x:\dir\subdir\Test\TestComponent.cshtml)
<                     LazyIntermediateToken - (179:10,1 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
<             CSharpCode - (188:11,7 [185] x:\dir\subdir\Test\TestComponent.cshtml)
<                 LazyIntermediateToken - (188:11,7 [185] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n    [Parameter] public TItem1 Item1 { get; set; }\n    [Parameter] public List<TItem2> Items2 { get; set; }\n    [Parameter] public RenderFragment<TItem2> ChildContent { get; set; }\n
---
>                 HtmlContent - (79:2,18 [2] x:\dir\subdir\Test\TestComponent.cshtml)
>                     LazyIntermediateToken - (79:2,18 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
>                 MarkupElement - (81:3,0 [14] x:\dir\subdir\Test\TestComponent.cshtml) - h1
>                     HtmlContent - (85:4,2 [5] x:\dir\subdir\Test\TestComponent.cshtml)
>                         LazyIntermediateToken - (85:4,2 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Item1
>                 HtmlContent - (95:4,12 [2] x:\dir\subdir\Test\TestComponent.cshtml)
>                     LazyIntermediateToken - (95:4,12 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
>                 CSharpCode - (98:4,15 [38] x:\dir\subdir\Test\TestComponent.cshtml)
>                     LazyIntermediateToken - (98:4,15 [38] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - foreach (var item2 in Items2)\n{\n    
>                 MarkupElement - (136:7,2 [40] x:\dir\subdir\Test\TestComponent.cshtml) - p
>                     HtmlContent - (139:7,5 [6] x:\dir\subdir\Test\TestComponent.cshtml)
>                         LazyIntermediateToken - (139:7,5 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n    
>                     CSharpExpression - (146:8,3 [19] x:\dir\subdir\Test\TestComponent.cshtml)
>                         LazyIntermediateToken - (146:8,3 [19] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ChildContent(item2)
>                     HtmlContent - (165:8,22 [7] x:\dir\subdir\Test\TestComponent.cshtml)
>                         LazyIntermediateToken - (165:8,22 [7] x:\dir\subdir\Test\TestComponent.cshtml) - Html - ;\n    
>                 CSharpCode - (176:9,6 [3] x:\dir\subdir\Test\TestComponent.cshtml)
>                     LazyIntermediateToken - (176:9,6 [3] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n}
>                 HtmlContent - (179:9,9 [2] x:\dir\subdir\Test\TestComponent.cshtml)
>                     LazyIntermediateToken - (179:9,9 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n
>             CSharpCode - (188:11,5 [185] x:\dir\subdir\Test\TestComponent.cshtml)
>                 LazyIntermediateToken - (188:11,5 [185] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n    [Parameter] public TItem1 Item1 { get; set; }\n    [Parameter] public List<TItem2> Items2 { get; set; }\n    [Parameter] public RenderFragment<TItem2> ChildContent { get; set; }\n
diff -br ComponentWithTypeParameters/TestComponent.mappings.txt ComponentWithTypeParameters_WithSemicolon/TestComponent.mappings.txt
11,12c11,12
< Source Location: (71:2,11 [6] x:\dir\subdir\Test\TestComponent.cshtml)
< |TItem2|
---
> Source Location: (71:2,10 [6] x:\dir\subdir\Test\TestComponent.cshtml)
> | TItem|
16,17c16,18
< Source Location: (98:5,1 [38] x:\dir\subdir\Test\TestComponent.cshtml)
< |foreach (var item2 in Items2)
---
> Source Location: (98:4,15 [38] x:\dir\subdir\Test\TestComponent.cshtml)
> |
> @foreach (var item2 in Items2)
20c21
< Generated Location: (1423:50,1 [38] )
---
> Generated Location: (1422:50,0 [38] )
25,27c26,28
< Source Location: (146:8,5 [19] x:\dir\subdir\Test\TestComponent.cshtml)
< |ChildContent(item2)|
< Generated Location: (1589:59,6 [19] )
---
> Source Location: (146:8,3 [19] x:\dir\subdir\Test\TestComponent.cshtml)
> | @ChildContent(item|
> Generated Location: (1588:59,6 [19] )
30,33c31,33
< Source Location: (176:9,8 [3] x:\dir\subdir\Test\TestComponent.cshtml)
< |
< }|
< Generated Location: (1740:66,8 [3] )
---
> Source Location: (176:9,6 [3] x:\dir\subdir\Test\TestComponent.cshtml)
| |p>
> Generated Location: (1737:66,6 [3] )
37,38c37,38
< Source Location: (188:11,7 [185] x:\dir\subdir\Test\TestComponent.cshtml)
< |
---
> Source Location: (188:11,5 [185] x:\dir\subdir\Test\TestComponent.cshtml)
> | {
41,43c41,42
<     [Parameter] public RenderFragment<TItem2> ChildContent { get; set; }
< |
< Generated Location: (1922:76,7 [185] )
---
>     [Parameter] public RenderFragment<TItem2> ChildContent { get; set; }|
> Generated Location: (1917:76,5 [185] )

diff -br ComponentWithConstrainedTypeParameters/ ComponentWithConstrainedTypeParameters_WithSemicolon/

Details ``` diff -br ComponentWithConstrainedTypeParameters/TestComponent.codegen.cs ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.codegen.cs 111c111 < #line 7 "x:\dir\subdir\Test\TestComponent.cshtml" --- > #line 6 "x:\dir\subdir\Test\TestComponent.cshtml" diff -br ComponentWithConstrainedTypeParameters/TestComponent.ir.txt ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.ir.txt 12,15c12,15 < DirectiveToken - (92:2,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) - TItem2 < DirectiveToken - (99:2,18 [19] x:\dir\subdir\Test\TestComponent.cshtml) - where TItem2 : ITag < DirectiveToken - (131:3,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) - TItem3 < DirectiveToken - (138:3,18 [27] x:\dir\subdir\Test\TestComponent.cshtml) - where TItem3 : Image, new() --- > DirectiveToken - (92:2,10 [6] x:\dir\subdir\Test\TestComponent.cshtml) - TItem2 > DirectiveToken - (99:2,17 [19] x:\dir\subdir\Test\TestComponent.cshtml) - where TItem2 : ITag > DirectiveToken - (131:3,9 [6] x:\dir\subdir\Test\TestComponent.cshtml) - TItem3 > DirectiveToken - (138:3,16 [27] x:\dir\subdir\Test\TestComponent.cshtml) - where TItem3 : Image, new() 25,51c25,51 < HtmlContent - (167:4,0 [2] x:\dir\subdir\Test\TestComponent.cshtml) < LazyIntermediateToken - (167:4,0 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n < MarkupElement - (169:5,0 [14] x:\dir\subdir\Test\TestComponent.cshtml) - h1 < HtmlContent - (173:5,4 [5] x:\dir\subdir\Test\TestComponent.cshtml) < LazyIntermediateToken - (173:5,4 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Item1 < HtmlContent - (183:5,14 [2] x:\dir\subdir\Test\TestComponent.cshtml) < LazyIntermediateToken - (183:5,14 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n < CSharpCode - (186:6,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) < LazyIntermediateToken - (186:6,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - foreach (var item2 in Items2)\n{\n < MarkupElement - (224:8,4 [40] x:\dir\subdir\Test\TestComponent.cshtml) - p < HtmlContent - (227:8,7 [6] x:\dir\subdir\Test\TestComponent.cshtml) < LazyIntermediateToken - (227:8,7 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n < CSharpExpression - (234:9,5 [19] x:\dir\subdir\Test\TestComponent.cshtml) < LazyIntermediateToken - (234:9,5 [19] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ChildContent(item2) < HtmlContent - (253:9,24 [7] x:\dir\subdir\Test\TestComponent.cshtml) < LazyIntermediateToken - (253:9,24 [7] x:\dir\subdir\Test\TestComponent.cshtml) - Html - ;\n < CSharpCode - (264:10,8 [3] x:\dir\subdir\Test\TestComponent.cshtml) < LazyIntermediateToken - (264:10,8 [3] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n} < HtmlContent - (267:11,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) < LazyIntermediateToken - (267:11,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n < MarkupElement - (271:13,0 [12] x:\dir\subdir\Test\TestComponent.cshtml) - p < HtmlContent - (274:13,3 [5] x:\dir\subdir\Test\TestComponent.cshtml) < LazyIntermediateToken - (274:13,3 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Item3 < HtmlContent - (283:13,12 [4] x:\dir\subdir\Test\TestComponent.cshtml) < LazyIntermediateToken - (283:13,12 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n < CSharpCode - (294:15,7 [236] x:\dir\subdir\Test\TestComponent.cshtml) < LazyIntermediateToken - (294:15,7 [236] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n [Parameter] public TItem1 Item1 { get; set; }\n [Parameter] public List Items2 { get; set; }\n [Parameter] public TItem3 Item3 { get; set; }\n [Parameter] public RenderFragment ChildContent { get; set; }\n --- > HtmlContent - (167:3,45 [2] x:\dir\subdir\Test\TestComponent.cshtml) > LazyIntermediateToken - (167:3,45 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n > MarkupElement - (169:3,47 [14] x:\dir\subdir\Test\TestComponent.cshtml) - h1 > HtmlContent - (173:5,1 [5] x:\dir\subdir\Test\TestComponent.cshtml) > LazyIntermediateToken - (173:5,1 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Item1 > HtmlContent - (183:5,11 [2] x:\dir\subdir\Test\TestComponent.cshtml) > LazyIntermediateToken - (183:5,11 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n > CSharpCode - (186:5,14 [38] x:\dir\subdir\Test\TestComponent.cshtml) > LazyIntermediateToken - (186:5,14 [38] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - foreach (var item2 in Items2)\n{\n > MarkupElement - (224:8,1 [40] x:\dir\subdir\Test\TestComponent.cshtml) - p > HtmlContent - (227:8,4 [6] x:\dir\subdir\Test\TestComponent.cshtml) > LazyIntermediateToken - (227:8,4 [6] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n > CSharpExpression - (234:9,2 [19] x:\dir\subdir\Test\TestComponent.cshtml) > LazyIntermediateToken - (234:9,2 [19] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - ChildContent(item2) > HtmlContent - (253:9,21 [7] x:\dir\subdir\Test\TestComponent.cshtml) > LazyIntermediateToken - (253:9,21 [7] x:\dir\subdir\Test\TestComponent.cshtml) - Html - ;\n > CSharpCode - (264:10,5 [3] x:\dir\subdir\Test\TestComponent.cshtml) > LazyIntermediateToken - (264:10,5 [3] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n} > HtmlContent - (267:10,8 [4] x:\dir\subdir\Test\TestComponent.cshtml) > LazyIntermediateToken - (267:10,8 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n > MarkupElement - (271:11,2 [12] x:\dir\subdir\Test\TestComponent.cshtml) - p > HtmlContent - (274:13,0 [5] x:\dir\subdir\Test\TestComponent.cshtml) > LazyIntermediateToken - (274:13,0 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Item3 > HtmlContent - (283:13,9 [4] x:\dir\subdir\Test\TestComponent.cshtml) > LazyIntermediateToken - (283:13,9 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n > CSharpCode - (294:15,4 [236] x:\dir\subdir\Test\TestComponent.cshtml) > LazyIntermediateToken - (294:15,4 [236] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n [Parameter] public TItem1 Item1 { get; set; }\n [Parameter] public List Items2 { get; set; }\n [Parameter] public TItem3 Item3 { get; set; }\n [Parameter] public RenderFragment ChildContent { get; set; }\n diff -br ComponentWithConstrainedTypeParameters/TestComponent.mappings.txt ComponentWithConstrainedTypeParameters_WithSemicolon/TestComponent.mappings.txt 16,17c16,17 < Source Location: (92:2,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) < |TItem2| --- > Source Location: (92:2,10 [6] x:\dir\subdir\Test\TestComponent.cshtml) > | TItem| 21,22c21,22 < Source Location: (99:2,18 [19] x:\dir\subdir\Test\TestComponent.cshtml) < |where TItem2 : ITag| --- > Source Location: (99:2,17 [19] x:\dir\subdir\Test\TestComponent.cshtml) > | where TItem2 : ITa| 26,27c26,27 < Source Location: (131:3,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) < |TItem3| --- > Source Location: (131:3,9 [6] x:\dir\subdir\Test\TestComponent.cshtml) > |m TIte| 31,32c31,32 < Source Location: (138:3,18 [27] x:\dir\subdir\Test\TestComponent.cshtml) < |where TItem3 : Image, new()| --- > Source Location: (138:3,16 [27] x:\dir\subdir\Test\TestComponent.cshtml) > |3 where TItem3 : Image, new| 36,37c36,38 < Source Location: (186:6,1 [38] x:\dir\subdir\Test\TestComponent.cshtml) < |foreach (var item2 in Items2) --- > Source Location: (186:5,14 [38] x:\dir\subdir\Test\TestComponent.cshtml) > | > @foreach (var item2 in Items2) 40c41 < Generated Location: (2868:111,1 [38] ) --- > Generated Location: (2881:111,14 [38] ) 45,47c46,48 < Source Location: (234:9,5 [19] x:\dir\subdir\Test\TestComponent.cshtml) < |ChildContent(item2)| < Generated Location: (3035:120,6 [19] ) --- > Source Location: (234:9,2 [19] x:\dir\subdir\Test\TestComponent.cshtml) > | @ChildContent(ite| > Generated Location: (3048:120,6 [19] ) 50,53c51,53 < Source Location: (264:10,8 [3] x:\dir\subdir\Test\TestComponent.cshtml) < | < }| < Generated Location: (3186:127,8 [3] ) --- > Source Location: (264:10,5 [3] x:\dir\subdir\Test\TestComponent.cshtml) > |/p>| > Generated Location: (3196:127,5 [3] ) 57,58c57,58 < Source Location: (294:15,7 [236] x:\dir\subdir\Test\TestComponent.cshtml) < | --- > Source Location: (294:15,4 [236] x:\dir\subdir\Test\TestComponent.cshtml) > |e { 62,64c62,63 < [Parameter] public RenderFragment ChildContent { get; set; } < | < Generated Location: (3368:137,7 [236] ) --- > [Parameter] public RenderFragment ChildContent { get; set; | > Generated Location: (3375:137,4 [236] ) ```

@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Sep 30, 2021
@TanayParikh TanayParikh requested a review from a team September 30, 2021 22:29
{
while (!At(SyntaxKind.NewLine))
{
if (At(SyntaxKind.Semicolon))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Support ; after @typeparam Something where Something : SomethingElse

}
}
}
else if (At(SyntaxKind.Semicolon))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Support ; after @typeparam Something

Copy link
Contributor

@pranavkm pranavkm left a comment

Choose a reason for hiding this comment

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

This looks great. Thanks for getting this sorted so quickly!

@TanayParikh
Copy link
Contributor Author

Manual validation via SDK on 6.0 successful.

@TanayParikh TanayParikh merged commit 63f2fa0 into main Oct 1, 2021
@TanayParikh TanayParikh deleted the taparik/supportSemicolonAfterTypeParam branch October 1, 2021 16:29
@ghost ghost added this to the 7.0-preview1 milestone Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@typeparam no longer allows trailing semi-colons

3 participants