dotnet / dotnet/csharplang

[Proposal]: Enhanced #line directives

Open
#4,747 13 comments 22 reactions 1 assignee Claimed by @MadsTorgersen View on GitHub
Implemented Needs ECMA Spec Proposal Proposal champion
Dominant language
C#
Stars
12.7k
Forks
1.1k
Avg merge
11h 1m
Merged PRs (30d)
3

Description

# Enhanced #line directives

* [x] Proposed
* [x] Prototype: Done
* [x] Implementation: Done
* [ ] Specification: Not Started

## Summary
[summary]: #summary
The compiler applies the mapping defined by `#line` directives to diagnostic locations and sequence points emitted to the PDB.

Currently only the line number and file path can be mapped while the starting character is inferred from the source code. The proposal is to allow specifying full span mapping.

`#line (startLine, startChar) - (endLine, endChar) charOffset "fileName"`

Spec: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-10.0/enhanced-line-directives.md

## Drawbacks
[drawbacks]: #drawbacks

## Alternatives
[alternatives]: #alternatives

## Unresolved questions
[unresolved]: #unresolved-questions

## Design meetings

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.