Skip to content

Commit 9c5408c

Browse files
authored
Detect terminal links with space, then line:col (microsoft#153957)
1 parent 9c3b0bb commit 9c5408c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/vs/workbench/contrib/terminal/browser/links/terminalLocalLinkDetector.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export const winLocalLinkClause = '((' + winPathPrefix + '|(' + winExcludedPathC
4949
/** As xterm reads from DOM, space in that case is nonbreaking char ASCII code - 160,
5050
replacing space with nonBreakningSpace or space ASCII code - 32. */
5151
export const lineAndColumnClause = [
52+
'(([^:\\s\\(\\)<>\'\"\\[\\]]*) ((\\d+))(:(\\d+)))', // (file path) 336:9 [see #140780]
5253
'((\\S*)[\'"], line ((\\d+)( column (\\d+))?))', // "(file path)", line 45 [see #40468]
5354
'((\\S*)[\'"],((\\d+)(:(\\d+))?))', // "(file path)",45 [see #78205]
5455
'((\\S*) on line ((\\d+)(, column (\\d+))?))', // (file path) on line 8, column 13

src/vs/workbench/contrib/terminal/test/browser/links/terminalLocalLinkDetector.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ const supportedLinkFormats: LinkFormatInfo[] = [
6868
{ urlFormat: '{0} ({1}, {2})', line: '5', column: '3' },
6969
{ urlFormat: '{0}:{1}', line: '5' },
7070
{ urlFormat: '{0}:{1}:{2}', line: '5', column: '3' },
71+
{ urlFormat: '{0} {1}:{2}', line: '5', column: '3' },
7172
{ urlFormat: '{0}[{1}]', line: '5' },
7273
{ urlFormat: '{0} [{1}]', line: '5' },
7374
{ urlFormat: '{0}[{1},{2}]', line: '5', column: '3' },

0 commit comments

Comments
 (0)