mirror of
https://github.com/Microsoft/vscode
synced 2024-10-13 23:09:01 +00:00
parent
f479fcd2e5
commit
796f945a2d
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue