Skip to content

Commit

Permalink
test header link, skip header link for old IPython
Browse files Browse the repository at this point in the history
  • Loading branch information
amunger committed Apr 19, 2024
1 parent 6ea2ca4 commit 3566902
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion extensions/notebook-renderers/src/stackTraceHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ function linkifyStack(stack: string): { formattedStack: string; errorLocation?:
};
const link = original.replace(inputRegex, `<a href=\'${fileOrCell.path}\'>$<cellLabel></a>`);
lines[i] = original.replace(inputRegex, `Input ${link}$<postfix>`);
locationLink = locationLink || link;

continue;
} else if (!fileOrCell || original.trim() === '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href=\'vscode-notebook-cell:?execution_count=2\'>In [2]</a>, in <cell line: 5>') > 0, 'Missing cell link in ' + formatted);
assert.ok(formatted.indexOf('Input <a href=\'vscode-notebook-cell:?execution_count=1\'>In [1]</a>, in myfunc()') > 0, 'Missing cell link in ' + formatted);
assert.ok(formatted.indexOf('<a href=\'vscode-notebook-cell:?execution_count=2&line=5\'>5</a>') > 0, 'Missing frame link in ' + formatted);
assert.equal(errorLocation, '<a href=\'vscode-notebook-cell:?execution_count=2\'>In [2]</a>');
});

test('IPython stack trace lines without associated location are not linkified', () => {
Expand Down

0 comments on commit 3566902

Please sign in to comment.