diff --git a/src/vs/workbench/parts/debug/browser/linkDetector.ts b/src/vs/workbench/parts/debug/browser/linkDetector.ts index 55657a248279d3e4eb780bf1298723f7688a0421..e75ea50966428fceea4c19260c038441e219f548 100644 --- a/src/vs/workbench/parts/debug/browser/linkDetector.ts +++ b/src/vs/workbench/parts/debug/browser/linkDetector.ts @@ -15,7 +15,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace export class LinkDetector { private static FILE_LOCATION_PATTERNS: RegExp[] = [ // group 0: full path with line and column - // group 1: full path without line and column, matched by `*.*` in the end to work only on paths with extensions in the end (s.t. http://test.com:8000 would not match) + // group 1: full path without line and column, matched by `*.*` in the end to work only on paths with extensions in the end (s.t. node:10352 would not match) // group 2: drive letter on windows with trailing backslash or leading slash on mac/linux // group 3: line number, matched by (:(\d+)) // group 4: column number, matched by ((?::(\d+))?) diff --git a/src/vs/workbench/parts/debug/electron-browser/replViewer.ts b/src/vs/workbench/parts/debug/electron-browser/replViewer.ts index f9fa4c9fbdd307c0b9eef6fa34b3bff4b7fb2733..3442772f59c3df22bd2fd542a65243818a12b6d6 100644 --- a/src/vs/workbench/parts/debug/electron-browser/replViewer.ts +++ b/src/vs/workbench/parts/debug/electron-browser/replViewer.ts @@ -86,11 +86,13 @@ export class ReplExpressionsRenderer implements IRenderer { private width: number; private characterWidth: number; + private linkDetector: LinkDetector; + constructor( @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IInstantiationService private instantiationService: IInstantiationService ) { - // noop + this.linkDetector = this.instantiationService.createInstance(LinkDetector); } public getHeight(tree: ITree, element: any): number { @@ -319,8 +321,7 @@ export class ReplExpressionsRenderer implements IRenderer { // flush text buffer if we have any if (buffer) { - const linkDetector = this.instantiationService.createInstance(LinkDetector); - this.insert(linkDetector.handleLinks(buffer), currentToken || tokensContainer); + this.insert(this.linkDetector.handleLinks(buffer), currentToken || tokensContainer); buffer = ''; } @@ -340,8 +341,7 @@ export class ReplExpressionsRenderer implements IRenderer { // flush remaining text buffer if we have any if (buffer) { - const linkDetector = this.instantiationService.createInstance(LinkDetector); - let res = linkDetector.handleLinks(buffer); + let res = this.linkDetector.handleLinks(buffer); if (typeof res !== 'string' || currentToken) { if (!tokensContainer) { tokensContainer = document.createElement('span');