Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt xterm.js link provider API #90298

Closed
Tyriar opened this issue Feb 8, 2020 · 0 comments · Fixed by #90336
Closed

Adopt xterm.js link provider API #90298

Tyriar opened this issue Feb 8, 2020 · 0 comments · Fixed by #90336
Assignees
Labels
debt Code quality issues feature-request Request for new features or functionality on-testplan terminal Integrated terminal issues
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Feb 8, 2020

Added in xtermjs/xterm.js#2530

This is part of #21125, to add a setting to opt into link detection based on VS Code's shared system. To close out #21125 we would need to make sure it all works and then properly support the local link system (and spaces in paths) done by this:

const pathPrefix = '(\\.\\.?|\\~)';
const pathSeparatorClause = '\\/';
// '":; are allowed in paths but they are often separators so ignore them
// Also disallow \\ to prevent a catastropic backtracking case #24798
const excludedPathCharactersClause = '[^\\0\\s!$`&*()\\[\\]+\'":;\\\\]';
/** A regex that matches paths in the form /foo, ~/foo, ./foo, ../foo, foo/bar */
const unixLocalLinkClause = '((' + pathPrefix + '|(' + excludedPathCharactersClause + ')+)?(' + pathSeparatorClause + '(' + excludedPathCharactersClause + ')+)+)';
const winDrivePrefix = '[a-zA-Z]:';
const winPathPrefix = '(' + winDrivePrefix + '|\\.\\.?|\\~)';
const winPathSeparatorClause = '(\\\\|\\/)';
const winExcludedPathCharactersClause = '[^\\0<>\\?\\|\\/\\s!$`&*()\\[\\]+\'":;]';
/** A regex that matches paths in the form c:\foo, ~\foo, .\foo, ..\foo, foo\bar */
const winLocalLinkClause = '((' + winPathPrefix + '|(' + winExcludedPathCharactersClause + ')+)?(' + winPathSeparatorClause + '(' + winExcludedPathCharactersClause + ')+)+)';
/** As xterm reads from DOM, space in that case is nonbreaking char ASCII code - 160,
replacing space with nonBreakningSpace or space ASCII code - 32. */
const lineAndColumnClause = [
'((\\S*)", line ((\\d+)( column (\\d+))?))', // "(file path)", line 45 [see #40468]
'((\\S*)",((\\d+)(:(\\d+))?))', // "(file path)",45 [see #78205]
'((\\S*) on line ((\\d+)(, column (\\d+))?))', // (file path) on line 8, column 13
'((\\S*):line ((\\d+)(, column (\\d+))?))', // (file path):line 8, column 13
'(([^\\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 []
'(([^:\\s\\(\\)<>\'\"\\[\\]]*)(:(\\d+))?(:(\\d+))?)' // (file path):336, (file path):336:9
].join('|').replace(/ /g, `[${'\u00A0'} ]`);

@Tyriar Tyriar added debt Code quality issues terminal Integrated terminal issues labels Feb 8, 2020
@Tyriar Tyriar self-assigned this Feb 8, 2020
@Tyriar Tyriar added this to the March 2020 milestone Feb 8, 2020
@Tyriar Tyriar modified the milestones: March 2020, Backlog Mar 27, 2020
@Tyriar Tyriar modified the milestones: Backlog, April 2020 Apr 12, 2020
@Tyriar Tyriar added feature-request Request for new features or functionality verification-needed Verification of issue is requested labels Apr 12, 2020
@Tyriar Tyriar added on-testplan and removed verification-needed Verification of issue is requested labels Apr 27, 2020
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues feature-request Request for new features or functionality on-testplan terminal Integrated terminal issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant