Skip to content

Commit 9ac6c54

Browse files
committed
Support space after comma in links like '[x, y]'
Fixes microsoft#26330
1 parent 7ba1dcf commit 9ac6c54

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ replacing space with nonBreakningSpace or space ASCII code - 32. */
3535
const lineAndColumnClause = [
3636
'((\\S*) on line ((\\d+)(, column (\\d+))?))', // (file path) on line 8, column 13
3737
'((\\S*):line ((\\d+)(, column (\\d+))?))', // (file path):line 8, column 13
38-
'(([^\\s\\(\\)]*)(\\s?[\\(\\[](\\d+)(,(\\d+))?)[\\)\\]])', // (file path)(45), (file path) (45), (file path)(45,18), (file path) (45,18)
38+
'(([^\\s\\(\\)]*)(\\s?[\\(\\[](\\d+)(,\\s?(\\d+))?)[\\)\\]])', // (file path)(45), (file path) (45), (file path)(45,18), (file path) (45,18), (file path)(45, 18), (file path) (45, 18), also with []
3939
'(([^:\\s\\(\\)<>\'\"\\[\\]]*)(:(\\d+))?(:(\\d+))?)' // (file path):336, (file path):336:9
4040
].join('|').replace(/ /g, `[${'\u00A0'} ]`);
4141

src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,16 @@ suite('Workbench - TerminalLinkHandler', () => {
9696
{ urlFormat: '{0} ({1})', line: '5' },
9797
{ urlFormat: '{0}({1},{2})', line: '5', column: '3' },
9898
{ urlFormat: '{0} ({1},{2})', line: '5', column: '3' },
99+
{ urlFormat: '{0}({1}, {2})', line: '5', column: '3' },
100+
{ urlFormat: '{0} ({1}, {2})', line: '5', column: '3' },
99101
{ urlFormat: '{0}:{1}', line: '5' },
100102
{ urlFormat: '{0}:{1}:{2}', line: '5', column: '3' },
101103
{ urlFormat: '{0}[{1}]', line: '5' },
102104
{ urlFormat: '{0} [{1}]', line: '5' },
103105
{ urlFormat: '{0}[{1},{2}]', line: '5', column: '3' },
104-
{ urlFormat: '{0} [{1},{2}]', line: '5', column: '3' }
106+
{ urlFormat: '{0} [{1},{2}]', line: '5', column: '3' },
107+
{ urlFormat: '{0}[{1}, {2}]', line: '5', column: '3' },
108+
{ urlFormat: '{0} [{1}, {2}]', line: '5', column: '3' }
105109
];
106110

107111
linkUrls.forEach(linkUrl => {

0 commit comments

Comments
 (0)