Unverified Commit 7f6c6f03 authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

Do not syntax highlight collapsed frames [ch1899] (#13684)

Co-authored-by: 's avatarkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
parent 4dd5616a
...@@ -68,9 +68,10 @@ export function getOriginalStackFrame( ...@@ -68,9 +68,10 @@ export function getOriginalStackFrame(
error: false, error: false,
reason: null, reason: null,
external: false, external: false,
expanded: expanded: !Boolean(
body.originalStackFrame?.file && /* collapsed */
!body.originalStackFrame.file.includes('node_modules'), body.originalStackFrame?.file?.includes('node_modules') ?? true
),
sourceStackFrame: source, sourceStackFrame: source,
originalStackFrame: body.originalStackFrame, originalStackFrame: body.originalStackFrame,
originalCodeFrame: body.originalCodeFrame || null, originalCodeFrame: body.originalCodeFrame || null,
......
...@@ -178,7 +178,9 @@ function getOverlayMiddleware(options: OverlayMiddlewareOptions) { ...@@ -178,7 +178,9 @@ function getOverlayMiddleware(options: OverlayMiddlewareOptions) {
} }
const originalCodeFrame: string | null = const originalCodeFrame: string | null =
posSourceContent && pos.line !(originalFrame.file?.includes('node_modules') ?? true) &&
posSourceContent &&
pos.line
? (codeFrameColumns( ? (codeFrameColumns(
posSourceContent, posSourceContent,
{ start: { line: pos.line, column: pos.column } }, { start: { line: pos.line, column: pos.column } },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment