mirror of
https://github.com/Microsoft/vscode
synced 2024-08-25 12:06:27 +00:00
Set base delegate, fix imports
This commit is contained in:
parent
d296f93650
commit
506cc7670a
|
@ -16,6 +16,9 @@ let hoverDelegateFactory: (placement: 'mouse' | 'element', enableInstantHover: b
|
|||
const defaultHoverDelegateMouse = new Lazy<IHoverDelegate>(() => hoverDelegateFactory('mouse', false));
|
||||
const defaultHoverDelegateElement = new Lazy<IHoverDelegate>(() => hoverDelegateFactory('element', false));
|
||||
|
||||
/**
|
||||
* @deprecated Use `setBaseLayerHoverDelegate` instead.
|
||||
*/
|
||||
export function setHoverDelegateFactory(hoverDelegateProvider: ((placement: 'mouse' | 'element', enableInstantHover: boolean) => IScopedHoverDelegate)): void {
|
||||
hoverDelegateFactory = hoverDelegateProvider;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { editorHoverBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { IHoverService, IHoverOptions } from 'vs/platform/hover/browser/hover';
|
||||
import { IHoverService } from 'vs/platform/hover/browser/hover';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { HoverWidget } from 'vs/editor/browser/services/hoverService/hoverWidget';
|
||||
|
@ -19,8 +19,8 @@ import { ResultKind } from 'vs/platform/keybinding/common/keybindingResolver';
|
|||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
import { mainWindow } from 'vs/base/browser/window';
|
||||
import { IHoverWidget } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { ContextViewHandler } from 'vs/platform/contextview/browser/contextViewService';
|
||||
import type { IHoverOptions, IHoverWidget } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
export class HoverService extends Disposable implements IHoverService {
|
||||
declare readonly _serviceBrand: undefined;
|
||||
|
|
|
@ -8,7 +8,6 @@ import { DisposableStore } from 'vs/base/common/lifecycle';
|
|||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IHoverTarget, IHoverOptions } from 'vs/platform/hover/browser/hover';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { EDITOR_FONT_DEFAULTS, IEditorOptions } from 'vs/editor/common/config/editorOptions';
|
||||
|
@ -23,7 +22,7 @@ import { localize } from 'vs/nls';
|
|||
import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { status } from 'vs/base/browser/ui/aria/aria';
|
||||
import { IHoverWidget } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import type { IHoverOptions, IHoverTarget, IHoverWidget } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
const $ = dom.$;
|
||||
type TargetRect = {
|
||||
|
|
|
@ -40,7 +40,8 @@ import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditor/diffEditor
|
|||
import { IAccessibilitySignalService } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
||||
import { mainWindow } from 'vs/base/browser/window';
|
||||
import { setHoverDelegateFactory } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
|
||||
import { WorkbenchHoverDelegate } from 'vs/platform/hover/browser/hover';
|
||||
import { IHoverService, WorkbenchHoverDelegate } from 'vs/platform/hover/browser/hover';
|
||||
import { setBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
|
||||
|
||||
/**
|
||||
* Description of an action contribution
|
||||
|
@ -272,6 +273,7 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon
|
|||
@ICodeEditorService codeEditorService: ICodeEditorService,
|
||||
@ICommandService commandService: ICommandService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IHoverService hoverService: IHoverService,
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@INotificationService notificationService: INotificationService,
|
||||
|
@ -293,6 +295,7 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon
|
|||
createAriaDomNode(options.ariaContainerElement);
|
||||
|
||||
setHoverDelegateFactory((placement, enableInstantHover) => instantiationService.createInstance(WorkbenchHoverDelegate, placement, enableInstantHover, {}));
|
||||
setBaseLayerHoverDelegate(hoverService);
|
||||
}
|
||||
|
||||
public addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null {
|
||||
|
@ -415,6 +418,7 @@ export class StandaloneEditor extends StandaloneCodeEditor implements IStandalon
|
|||
@ICodeEditorService codeEditorService: ICodeEditorService,
|
||||
@ICommandService commandService: ICommandService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IHoverService hoverService: IHoverService,
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@IStandaloneThemeService themeService: IStandaloneThemeService,
|
||||
@INotificationService notificationService: INotificationService,
|
||||
|
@ -436,7 +440,7 @@ export class StandaloneEditor extends StandaloneCodeEditor implements IStandalon
|
|||
}
|
||||
const _model: ITextModel | null | undefined = options.model;
|
||||
delete options.model;
|
||||
super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService, keybindingService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService);
|
||||
super(domElement, options, instantiationService, codeEditorService, commandService, contextKeyService, hoverService, keybindingService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService);
|
||||
|
||||
this._configurationService = configurationService;
|
||||
this._standaloneThemeService = themeService;
|
||||
|
|
|
@ -29,8 +29,9 @@ import { IInputBox, IKeyMods, IQuickInput, IQuickInputButton, IQuickInputHideEve
|
|||
import { QuickInputBox } from './quickInputBox';
|
||||
import { quickInputButtonToAction, renderQuickInputDescription } from './quickInputUtils';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IHoverOptions, IHoverService, WorkbenchHoverDelegate } from 'vs/platform/hover/browser/hover';
|
||||
import { IHoverService, WorkbenchHoverDelegate } from 'vs/platform/hover/browser/hover';
|
||||
import { QuickInputListFocus, QuickInputTree } from 'vs/platform/quickinput/browser/quickInputTree';
|
||||
import type { IHoverOptions } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
export interface IQuickInputOptions {
|
||||
idPrefix: string;
|
||||
|
|
|
@ -27,7 +27,7 @@ import { KeybindingLabel } from 'vs/base/browser/ui/keybindingLabel/keybindingLa
|
|||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { isDark } from 'vs/platform/theme/common/theme';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IHoverWidget, ITooltipMarkdownString } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { ITooltipMarkdownString } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { quickInputButtonToAction } from 'vs/platform/quickinput/browser/quickInputUtils';
|
||||
import { Lazy } from 'vs/base/common/lazy';
|
||||
import { IParsedLabelWithIcons, getCodiconAriaLabel, matchesFuzzyIconAware, parseLabelWithIcons } from 'vs/base/common/iconLabels';
|
||||
|
@ -37,6 +37,7 @@ import { ltrim } from 'vs/base/common/strings';
|
|||
import { RenderIndentGuides } from 'vs/base/browser/ui/tree/abstractTree';
|
||||
import { ThrottledDelayer } from 'vs/base/common/async';
|
||||
import { isCancellationError } from 'vs/base/common/errors';
|
||||
import type { IHoverWidget } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
const $ = dom.$;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
|
|||
import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { badgeBackground, badgeForeground, contrastBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { IHoverWidget } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import type { IHoverWidget } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
export interface ICompositeBar {
|
||||
|
||||
|
|
|
@ -43,8 +43,9 @@ import { IHostService } from 'vs/workbench/services/host/browser/host';
|
|||
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { mainWindow } from 'vs/base/browser/window';
|
||||
import { PixelRatio } from 'vs/base/browser/pixelRatio';
|
||||
import { WorkbenchHoverDelegate } from 'vs/platform/hover/browser/hover';
|
||||
import { IHoverService, WorkbenchHoverDelegate } from 'vs/platform/hover/browser/hover';
|
||||
import { setHoverDelegateFactory } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
|
||||
import { setBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
|
||||
|
||||
export interface IWorkbenchOptions {
|
||||
|
||||
|
@ -151,12 +152,14 @@ export class Workbench extends Layout {
|
|||
const storageService = accessor.get(IStorageService);
|
||||
const configurationService = accessor.get(IConfigurationService);
|
||||
const hostService = accessor.get(IHostService);
|
||||
const hoverService = accessor.get(IHoverService);
|
||||
const dialogService = accessor.get(IDialogService);
|
||||
const notificationService = accessor.get(INotificationService) as NotificationService;
|
||||
|
||||
// Default Hover Delegate must be registered before creating any workbench/layout components
|
||||
// as these possibly will use the default hover delegate
|
||||
setHoverDelegateFactory((placement, enableInstantHover) => instantiationService.createInstance(WorkbenchHoverDelegate, placement, enableInstantHover, {}));
|
||||
setBaseLayerHoverDelegate(hoverService);
|
||||
|
||||
// Layout
|
||||
this.initLayout(accessor);
|
||||
|
|
|
@ -68,7 +68,7 @@ import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget';
|
|||
import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
||||
import { mainWindow } from 'vs/base/browser/window';
|
||||
import { IExplorerFileContribution, explorerFileContribRegistry } from 'vs/workbench/contrib/files/browser/explorerFileContrib';
|
||||
import { IHoverWidget } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import type { IHoverWidget } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
export class ExplorerDelegate implements IListVirtualDelegate<ExplorerItem> {
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ import { IUserDataSyncEnablementService } from 'vs/platform/userDataSync/common/
|
|||
import { SettingsTreeSettingElement } from 'vs/workbench/contrib/preferences/browser/settingsTreeModels';
|
||||
import { POLICY_SETTING_TAG } from 'vs/workbench/contrib/preferences/common/preferences';
|
||||
import { IWorkbenchConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
|
||||
import { IHoverOptions, IHoverService } from 'vs/platform/hover/browser/hover';
|
||||
import { IHoverWidget } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { IHoverService } from 'vs/platform/hover/browser/hover';
|
||||
import type { IHoverOptions, IHoverWidget } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
const $ = DOM.$;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import { Codicon } from 'vs/base/common/codicons';
|
|||
import { Action } from 'vs/base/common/actions';
|
||||
import { DEFAULT_LABELS_CONTAINER, IResourceLabel, ResourceLabels } from 'vs/workbench/browser/labels';
|
||||
import { IDecorationData, IDecorationsProvider, IDecorationsService } from 'vs/workbench/services/decorations/common/decorations';
|
||||
import { IHoverAction, IHoverService } from 'vs/platform/hover/browser/hover';
|
||||
import { IHoverService } from 'vs/platform/hover/browser/hover';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { Disposable, DisposableStore, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IListDragAndDrop, IListDragOverReaction, IListRenderer, ListDragOverEffectPosition, ListDragOverEffectType } from 'vs/base/browser/ui/list/list';
|
||||
|
@ -50,6 +50,7 @@ import { Emitter } from 'vs/base/common/event';
|
|||
import { Schemas } from 'vs/base/common/network';
|
||||
import { getColorForSeverity } from 'vs/workbench/contrib/terminal/browser/terminalStatusList';
|
||||
import { TerminalContextActionRunner } from 'vs/workbench/contrib/terminal/browser/terminalContextMenu';
|
||||
import type { IHoverAction } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
const $ = DOM.$;
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ import { localize } from 'vs/nls';
|
|||
import { ITerminalInstance } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities';
|
||||
import { asArray } from 'vs/base/common/arrays';
|
||||
import { IHoverAction } from 'vs/platform/hover/browser/hover';
|
||||
import { MarkdownString } from 'vs/base/common/htmlContent';
|
||||
import type { IHoverAction } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
export function getInstanceHoverInfo(instance: ITerminalInstance): { content: MarkdownString; actions: IHoverAction[] } {
|
||||
let statusString = '';
|
||||
|
|
|
@ -9,9 +9,10 @@ import { Widget } from 'vs/base/browser/ui/widget';
|
|||
import { ITerminalWidget } from 'vs/workbench/contrib/terminal/browser/widgets/widgets';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import type { IViewportRange } from '@xterm/xterm';
|
||||
import { IHoverTarget, IHoverService, IHoverAction } from 'vs/platform/hover/browser/hover';
|
||||
import { IHoverService } from 'vs/platform/hover/browser/hover';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { TerminalSettingId } from 'vs/platform/terminal/common/terminal';
|
||||
import type { IHoverAction, IHoverTarget } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
const $ = dom.$;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
import type { IBufferLine, IBufferRange, Terminal } from '@xterm/xterm';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IHoverAction } from 'vs/platform/hover/browser/hover';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ITerminalProcessManager } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { IParsedLink } from 'vs/workbench/contrib/terminalContrib/links/browser/terminalLinkParsing';
|
||||
|
@ -14,6 +13,7 @@ import { ITerminalExternalLinkProvider } from 'vs/workbench/contrib/terminal/bro
|
|||
import { Event } from 'vs/base/common/event';
|
||||
import { ITerminalBackend } from 'vs/platform/terminal/common/terminal';
|
||||
import { ITextEditorSelection } from 'vs/platform/editor/common/editor';
|
||||
import type { IHoverAction } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
export const ITerminalLinkProviderService = createDecorator<ITerminalLinkProviderService>('terminalLinkProviderService');
|
||||
export interface ITerminalLinkProviderService {
|
||||
|
|
|
@ -12,9 +12,9 @@ import { isMacintosh } from 'vs/base/common/platform';
|
|||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { TerminalLinkType } from 'vs/workbench/contrib/terminalContrib/links/browser/links';
|
||||
import { IHoverAction } from 'vs/platform/hover/browser/hover';
|
||||
import type { URI } from 'vs/base/common/uri';
|
||||
import type { IParsedLink } from 'vs/workbench/contrib/terminalContrib/links/browser/terminalLinkParsing';
|
||||
import type { IHoverAction } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
export class TerminalLink extends DisposableStore implements ILink {
|
||||
decorations: ILinkDecorations;
|
||||
|
|
|
@ -26,13 +26,13 @@ import { TerminalWidgetManager } from 'vs/workbench/contrib/terminal/browser/wid
|
|||
import { IXtermCore } from 'vs/workbench/contrib/terminal/browser/xterm-private';
|
||||
import { ITerminalCapabilityStore } from 'vs/platform/terminal/common/capabilities/capabilities';
|
||||
import { ITerminalConfiguration, ITerminalProcessInfo, TERMINAL_CONFIG_SECTION } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { IHoverAction } from 'vs/platform/hover/browser/hover';
|
||||
import type { ILink, ILinkProvider, IViewportRange, Terminal } from '@xterm/xterm';
|
||||
import { convertBufferRangeToViewport } from 'vs/workbench/contrib/terminalContrib/links/browser/terminalLinkHelpers';
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import { ITerminalLogService } from 'vs/platform/terminal/common/terminal';
|
||||
import { TerminalMultiLineLinkDetector } from 'vs/workbench/contrib/terminalContrib/links/browser/terminalMultiLineLinkDetector';
|
||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
import type { IHoverAction } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
export type XtermLinkMatcherHandler = (event: MouseEvent | undefined, link: string) => Promise<void>;
|
||||
|
||||
|
|
|
@ -77,9 +77,9 @@ import { IHoverService } from 'vs/platform/hover/browser/hover';
|
|||
import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget';
|
||||
import { DEFAULT_ICON, ICONS } from 'vs/workbench/services/userDataProfile/common/userDataProfileIcons';
|
||||
import { WorkbenchIconSelectBox } from 'vs/workbench/services/userDataProfile/browser/iconSelectBox';
|
||||
import { IHoverWidget } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import type { IHoverWidget } from 'vs/base/browser/ui/hover/hover';
|
||||
|
||||
interface IUserDataProfileTemplate {
|
||||
readonly name: string;
|
||||
|
|
Loading…
Reference in a new issue