@@ -13,6 +13,7 @@ import { ITerminalCapabilityStore, TerminalCapability } from 'vs/platform/termin
13
13
import { IBufferLine , IBufferRange , Terminal } from 'xterm' ;
14
14
import { ITerminalBackend , ITerminalProcessManager } from 'vs/workbench/contrib/terminal/common/terminal' ;
15
15
import { detectLinks } from 'vs/workbench/contrib/terminalContrib/links/browser/terminalLinkParsing' ;
16
+ import { ILogService } from 'vs/platform/log/common/log' ;
16
17
17
18
const enum Constants {
18
19
/**
@@ -69,6 +70,7 @@ export class TerminalLocalLinkDetector implements ITerminalLinkDetector {
69
70
private readonly _capabilities : ITerminalCapabilityStore ,
70
71
private readonly _processManager : Pick < ITerminalProcessManager , 'initialCwd' | 'os' | 'remoteAuthority' | 'userHome' > & { backend ?: Pick < ITerminalBackend , 'getWslPath' > } ,
71
72
private readonly _linkResolver : ITerminalLinkResolver ,
73
+ @ILogService private readonly _logService : ILogService ,
72
74
@IUriIdentityService private readonly _uriIdentityService : IUriIdentityService ,
73
75
@IWorkspaceContextService private readonly _workspaceContextService : IWorkspaceContextService
74
76
) {
@@ -88,7 +90,10 @@ export class TerminalLocalLinkDetector implements ITerminalLinkDetector {
88
90
89
91
const os = this . _processManager . os || OS ;
90
92
const parsedLinks = detectLinks ( text , os ) ;
93
+ this . _logService . trace ( 'terminalLocaLinkDetector#detect text' , text ) ;
94
+ this . _logService . trace ( 'terminalLocaLinkDetector#detect parsedLinks' , parsedLinks ) ;
91
95
for ( const parsedLink of parsedLinks ) {
96
+
92
97
// Don't try resolve any links of excessive length
93
98
if ( parsedLink . path . text . length > Constants . MaxResolvedLinkLength ) {
94
99
continue ;
@@ -147,6 +152,7 @@ export class TerminalLocalLinkDetector implements ITerminalLinkDetector {
147
152
}
148
153
}
149
154
linkCandidates . push ( ...specialEndLinkCandidates ) ;
155
+ this . _logService . trace ( 'terminalLocaLinkDetector#detect linkCandidates' , linkCandidates ) ;
150
156
151
157
// Validate the path and convert to the outgoing type
152
158
const simpleLink = await this . _validateAndGetLink ( undefined , bufferRange , linkCandidates , trimRangeMap ) ;
@@ -156,6 +162,7 @@ export class TerminalLocalLinkDetector implements ITerminalLinkDetector {
156
162
parsedLink . prefix ?. index ?? parsedLink . path . index ,
157
163
parsedLink . suffix ? parsedLink . suffix . suffix . index + parsedLink . suffix . suffix . text . length : parsedLink . path . index + parsedLink . path . text . length
158
164
) ;
165
+ this . _logService . trace ( 'terminalLocaLinkDetector#detect verified link' , simpleLink ) ;
159
166
links . push ( simpleLink ) ;
160
167
}
161
168
0 commit comments