question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expand #line to support columns

See original GitHub issue

The 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.

  1. Errors. Any error that maps to DateTime.Now is instantly misaligned because @DateTime.Now exists at the front of the line.
  2. 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:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
tmatcommented, May 6, 2021

I’m working on a proposal for adding column to #line directive.

1reaction
tmatcommented, Aug 3, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found