Skip to content

Commit 5e71e0b

Browse files
committed
Revert "fix output links for IPython 9 (#248349)" (#252017)
This reverts commit e5ddb82.
1 parent 18e3a1e commit 5e71e0b

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

extensions/notebook-renderers/src/stackTraceHelper.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ export function formatStackTrace(stack: string, trustHtml: boolean): { formatted
3232

3333
const formatSequence = /\u001b\[.+?m/g;
3434
const fileRegex = /File\s+(?:\u001b\[.+?m)?(.+):(\d+)/;
35-
// look for the "--->" before a line number
36-
const lineNumberRegex = /^((?:\u001b\[.+?m|\s)*[-]+>(?:\u001b\[.+?m|\s)*)(\d+)(?:\u001b\[.+?m)*( .*)/;
37-
// just capturing parts of "Cell In[3], line 2" with lots of formatting in between
38-
const cellRegex = /(?<prefix>(?:\u001b\[.+?m)*Cell(?:\u001b\[.+?m|\s)*In(?:\u001b\[.+?m|\s)*\[(?<executionCount>\d+)\](?:\u001b\[.+?m|\s|,)+)(?<lineLabel>line (?<lineNumber>\d+)).*/;
35+
const lineNumberRegex = /^((?:\u001b\[.+?m)?[ \->]+?)(\d+)(?:\u001b\[0m)?( .*)/;
36+
const cellRegex = /(?<prefix>Cell\s+(?:\u001b\[.+?m)?In\s*\[(?<executionCount>\d+)\],\s*)(?<lineLabel>line (?<lineNumber>\d+)).*/;
3937
// older versions of IPython ~8.3.0
4038
const inputRegex = /(?<prefix>Input\s+?(?:\u001b\[.+?m)(?<cellLabel>In\s*\[(?<executionCount>\d+)\]))(?<postfix>.*)/;
4139

extensions/notebook-renderers/src/test/stackTraceHelper.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ suite('StackTraceHelper', () => {
4545
assert.equal(errorLocation, '<a href=\'vscode-notebook-cell:?execution_count=3&line=2\'>line 2</a>');
4646
});
4747

48-
test('IPython stack line numbers are linkified for IPython 9.0.0', () => {
48+
test.skip('IPython stack line numbers are linkified for IPython 9.0.0', () => {
4949
const stack =
5050
'\u001b[31m---------------------------------------------------------------------------\u001b[39m\n' +
5151
'\u001b[31mTypeError\u001b[39m Traceback (most recent call last)\n' +

0 commit comments

Comments
 (0)