From 35669024eb72936f825f03b1bdbd77faf96f7422 Mon Sep 17 00:00:00 2001 From: Aaron Munger Date: Fri, 19 Apr 2024 11:29:00 -0700 Subject: [PATCH] test header link, skip header link for old IPython --- extensions/notebook-renderers/src/stackTraceHelper.ts | 1 - .../notebook-renderers/src/test/stackTraceHelper.test.ts | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/extensions/notebook-renderers/src/stackTraceHelper.ts b/extensions/notebook-renderers/src/stackTraceHelper.ts index 30394256d72bd..ecf0eddb40ebc 100644 --- a/extensions/notebook-renderers/src/stackTraceHelper.ts +++ b/extensions/notebook-renderers/src/stackTraceHelper.ts @@ -80,7 +80,6 @@ function linkifyStack(stack: string): { formattedStack: string; errorLocation?: }; const link = original.replace(inputRegex, `$`); lines[i] = original.replace(inputRegex, `Input ${link}$`); - locationLink = locationLink || link; continue; } else if (!fileOrCell || original.trim() === '') { diff --git a/extensions/notebook-renderers/src/test/stackTraceHelper.test.ts b/extensions/notebook-renderers/src/test/stackTraceHelper.test.ts index 6e318cdc569e0..54ec15b428caa 100644 --- a/extensions/notebook-renderers/src/test/stackTraceHelper.test.ts +++ b/extensions/notebook-renderers/src/test/stackTraceHelper.test.ts @@ -67,12 +67,11 @@ suite('StackTraceHelper', () => { '\n' + '\u001b[1;31mException\u001b[0m:\n'; - const { formattedStack, errorLocation } = formatStackTrace(stack); + const { formattedStack } = formatStackTrace(stack); const formatted = stripAsciiFormatting(formattedStack); assert.ok(formatted.indexOf('Input In [2], in ') > 0, 'Missing cell link in ' + formatted); assert.ok(formatted.indexOf('Input In [1], in myfunc()') > 0, 'Missing cell link in ' + formatted); assert.ok(formatted.indexOf('5') > 0, 'Missing frame link in ' + formatted); - assert.equal(errorLocation, 'In [2]'); }); test('IPython stack trace lines without associated location are not linkified', () => {