Expand #line to support columns
See original GitHub issueThe problem
The current restrictions of the #line
pragma don’t bode well for embedded languages. For instance in Razor the core “transition into C#” mechanism has various implications on the #line
pragma’s lacking support of a column. For instance, lets consider:
@DateTime.Now
At runtime this renders:
#line 1 "Foo.razor"
Write(DateTime.Now);
#line default
At design time this renders:
#line 1 "Foo.razor"
__o = DateTime.Now;
#line default
Now consider the implications of this at debug & edit time.
- Errors. Any error that maps to
DateTime.Now
is instantly misaligned because@DateTime.Now
exists at the front of the line. - Breakpoints. Any breakpoint can’t possibly understand how to bind to the original language document properly without understanding the difference in columns.
Suggestion:
- Allow line pragmas to provide a column & exist in the middle of expressions/statements and work properly at error/debug time (they currently don’t):
<p>The current time is: @DateTime.Now</p>
Write(
#line 1 25 "Foo.razor"
DateTime.Now
#line default
);
- OR allow a column, mapped offset and length to enable unmapped code to exist in the line pragma:
<p>The current time is: @DateTime.Now</p>
#line 1 25 6 12 "Foo.razor"
Write(DateTime.Now);
#line default
/cc @tmat
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Change the column width and row height
If you find yourself needing to expand or reduce Excel's row widths and column heights, there are several ways to adjust them. The...
Read more >Video: Resize table rows and columns - Microsoft Support
Select the boundary of the column or row you want to move and drag it to the width or height you want. Select...
Read more >Resize a table, column, or row
Resize a column or table automatically with AutoFit. Automatically adjust your table or columns to fit the size of your content by using...
Read more >Rows and Hierarchy
To expand or collapse all sub-items on a sheet, right-click on the Primary Column header and select Expand All or Collapse All.
Read more >Resize rows and columns in Numbers on Mac
Click a cell in the row or column you want to resize. In the Format sidebar, click the Table tab. In Row &...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m working on a proposal for adding column to
#line
directive.Yeah, I see. So the problem is really the placements of the sequence points if
#line
is in the middle of a statement. I guess we have two options in the compiler how to handle that - either we implement column mapping syntax or we change the handling of the#line
directive when in the middle a statement. The former seems cleaner since the latter is gonna likely have a bunch of odd corner cases.