-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed as not planned
Closed as not planned
Copy link
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
π Search Terms
createSourceFile newlines trim
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about createSourceFile
β― Playground Link
No response
π» Code
import React from 'react';
export default function HelloWorldView() {
return <span>Hello</span>;
}
π Actual behavior
Given this TSX file, React tooling will store a source reference on the <span>
element as e.g.
$0.__reactFiber$wzqrbgzp6o._debugSource
and it will contain
{
columnNumber: 10,
fileName: ".../something.tsx",
lineNumber: 7
}
However, if you feed the TSX file into ts.createSourceFile
and look for an element on line 7, you will not find anything because the file has been changed to
import React from 'react';
export default function HelloWorldView() {
return <span>Hello</span>;
}
and it only has 5 lines
π Expected behavior
ts.createSourceFile does no transformations whatsoever on the given input
Additional information about the issue
No response
taefi
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code