Proposal: support #line directive so we can use other tools and have sane line numbers for errors & outputs. #34608
Closed
5 tasks done
Labels
Declined
The issue was declined as something which matches the TypeScript vision
Suggestion
An idea for TypeScript
Search Terms
#line
preprocessing directiveSuggestion
the c++ preprocessor adds #line directives and some other preprocessing tools do similar as well. And it's a good way to have multiple preprecossors act on a single file in a pipeline.
This proposal is just only supporting the '#line` directive so that other tools can do the job of preprocessing. Other existing issues such as Preprocessor directives proposal propose more kinds of directives and a more complete set of directives.
Additionally this proposal would support the preprocessor output of clang/gcc for line changes in the form of
# 1 "some/path/file.ts 1
which is very similar to #line directive.
Use Cases
I want to run c preprocessor on my typescript file and feed it directly to tsc. By supporting this directive typescript will be able to give proper line numbers and generate a more sensible source mappings.
Examples
Now for error reporting and generation of source maps I expect it to map to respective file and line number.
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: