Skip to content

Commit

Permalink
Fix cursor position
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Dec 3, 2024
1 parent 66f56f1 commit 80d04e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,13 @@ async function nativeTraceSource(
?.replace('__WEBPACK_DEFAULT_EXPORT__', 'default')
?.replace('__webpack_exports__.', '') ||
'<unknown>',
column: originalPosition.column ?? 0,
file: originalPosition.source,
column: (originalPosition.column ?? 0) + 1,
file: originalPosition.source?.startsWith('file://')
? path.relative(
process.cwd(),
url.fileURLToPath(originalPosition.source)
)
: originalPosition.source,
lineNumber: originalPosition.line ?? 0,
// TODO: c&p from async createOriginalStackFrame but why not frame.arguments?
arguments: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ const isOwnerStackEnabled =
`"at Page (app/rsc/page.tsx (6:13))"`
)
expect(source).toMatchInlineSnapshot(`
"app/rsc/page.tsx (7:9) @ <anonymous>
"app/rsc/page.tsx (7:10) @ <anonymous>
5 | <div>
6 | {list.map((item, index) => (
> 7 | <span>{item}</span>
| ^
| ^
8 | ))}
9 | </div>
10 | )"
Expand Down

0 comments on commit 80d04e5

Please sign in to comment.