Adopt workbench.hover.delay in the terminal (#120134)

* fix #119329
This commit is contained in:
Megan Rogge
2021-03-30 02:21:26 +00:00
committed by GitHub
parent 768ea66254
commit 97044c900a
2 changed files with 3 additions and 5 deletions
@@ -8,10 +8,10 @@ import { DisposableStore } from 'vs/base/common/lifecycle';
import * as dom from 'vs/base/browser/dom';
import { RunOnceScheduler } from 'vs/base/common/async';
import { convertBufferRangeToViewport } from 'vs/workbench/contrib/terminal/browser/links/terminalLinkHelpers';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { isMacintosh } from 'vs/base/common/platform';
import { localize } from 'vs/nls';
import { Emitter, Event } from 'vs/base/common/event';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
export const OPEN_FILE_LABEL = localize('openFile', 'Open file in editor');
export const FOLDER_IN_WORKSPACE_LABEL = localize('focusFolder', 'Focus folder in explorer');
@@ -81,7 +81,6 @@ export class TerminalLink extends DisposableStore implements ILink {
// Only show the tooltip and highlight for high confidence links (not word/search workspace
// links). Feedback was that this makes using the terminal overly noisy.
if (this._isHighConfidenceLink) {
const timeout = this._configurationService.getValue<number>('editor.hover.delay');
this._tooltipScheduler = new RunOnceScheduler(() => {
this._tooltipCallback(
this,
@@ -92,7 +91,7 @@ export class TerminalLink extends DisposableStore implements ILink {
// Clear out scheduler until next hover event
this._tooltipScheduler?.dispose();
this._tooltipScheduler = undefined;
}, timeout);
}, this._configurationService.getValue<number>('workbench.hover.delay'));
this.add(this._tooltipScheduler);
this._tooltipScheduler.schedule();
}
@@ -41,8 +41,7 @@ export class EnvironmentVariableInfoWidget extends Widget implements ITerminalWi
}
container.appendChild(this._domNode);
const timeout = this._configurationService.getValue<number>('editor.hover.delay');
const scheduler: RunOnceScheduler = new RunOnceScheduler(() => this._showHover(), timeout);
const scheduler: RunOnceScheduler = new RunOnceScheduler(() => this._showHover(), this._configurationService.getValue<number>('workbench.hover.delay'));
this._register(scheduler);
let origin = { x: 0, y: 0 };