mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-27 02:27:53 +01:00
@@ -226,12 +226,15 @@ export class TerminalLinkHandler {
|
||||
|
||||
private _resolvePath(link: string): TPromise<string> {
|
||||
link = this._preprocessPath(link);
|
||||
|
||||
if (!link) {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
const linkUrl = this.extractLinkUrl(link);
|
||||
if (!linkUrl) {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
// Open an editor if the path exists
|
||||
return pfs.fileExists(linkUrl).then(isFile => {
|
||||
if (!isFile) {
|
||||
@@ -292,6 +295,9 @@ export class TerminalLinkHandler {
|
||||
*/
|
||||
public extractLinkUrl(link: string): string {
|
||||
const matches: string[] = this._localLinkRegex.exec(link);
|
||||
if (!matches) {
|
||||
return null;
|
||||
}
|
||||
return matches[1];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user