Skip to content

Commit 48089b3

Browse files
committed
Share word link handler to hover follow link
Fixes microsoft#95246
1 parent 61db9a5 commit 48089b3

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/vs/workbench/contrib/terminal/browser/links/terminalLinkManager.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,7 @@ export class TerminalLinkManager extends DisposableStore {
323323
));
324324

325325
// Word links
326-
const tooltipWordCallback = (event: MouseEvent, link: string, location: IViewportRange) => {
327-
this._tooltipCallback(event, link, location, link => this._quickInputService.quickAccess.show(link));
328-
};
329-
const wrappedWordActivateCallback = this._wrapLinkHandler(async link => {
326+
const wordHandler = async (link: string) => {
330327
const results = await this._searchService.fileSearch(
331328
this._fileQueryBuilder.file(this._workspaceContextService.getWorkspace().folders, {
332329
filePattern: link,
@@ -343,7 +340,11 @@ export class TerminalLinkManager extends DisposableStore {
343340

344341
// Fallback to searching quick access
345342
this._quickInputService.quickAccess.show(link);
346-
});
343+
};
344+
const tooltipWordCallback = (event: MouseEvent, link: string, location: IViewportRange) => {
345+
this._tooltipCallback(event, link, location, wordHandler);
346+
};
347+
const wrappedWordActivateCallback = this._wrapLinkHandler(wordHandler);
347348
this._linkProviders.push(this._xterm.registerLinkProvider(
348349
this._instantiationService.createInstance(TerminalWordLinkProvider, this._xterm, wrappedWordActivateCallback, tooltipWordCallback, this._leaveCallback)
349350
));

0 commit comments

Comments
 (0)