mirror of
https://github.com/Microsoft/vscode
synced 2024-08-25 03:56:03 +00:00
Add deprecated annotations to old functions
This commit is contained in:
parent
85fb8cb6fd
commit
815dcf06b5
|
@ -23,6 +23,10 @@ export function setHoverDelegateFactory(hoverDelegateProvider: ((placement: 'mou
|
|||
hoverDelegateFactory = hoverDelegateProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated If in the `base/` layer use `getBaseLayerHoverDelegate` instead, if in `platform/`
|
||||
* and higher use `IHoverService.setupUpdatableHover` instead.
|
||||
*/
|
||||
export function getDefaultHoverDelegate(placement: 'mouse' | 'element'): IHoverDelegate {
|
||||
if (placement === 'element') {
|
||||
return defaultHoverDelegateElement.value;
|
||||
|
@ -30,6 +34,7 @@ export function getDefaultHoverDelegate(placement: 'mouse' | 'element'): IHoverD
|
|||
return defaultHoverDelegateMouse.value;
|
||||
}
|
||||
|
||||
// TODO: Create equivalent in IHoverService
|
||||
export function createInstantHoverDelegate(): IScopedHoverDelegate {
|
||||
// Creates a hover delegate with instant hover enabled.
|
||||
// This hover belongs to the consumer and requires the them to dispose it.
|
||||
|
|
|
@ -17,6 +17,7 @@ import type { IHoverWidget, IUpdatableHover, IUpdatableHoverContent, IUpdatableH
|
|||
|
||||
type IUpdatableHoverResolvedContent = IMarkdownString | string | HTMLElement | undefined;
|
||||
|
||||
// TODO: Create equivalent in IHoverService
|
||||
export function setupNativeHover(htmlElement: HTMLElement, tooltip: string | IUpdatableHoverTooltipMarkdownString | undefined): void {
|
||||
if (isString(tooltip)) {
|
||||
// Icons don't render in the native hover so we strip them out
|
||||
|
@ -130,6 +131,9 @@ function getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement):
|
|||
return element;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `IHoverService.createUpdatableHover` instead.
|
||||
*/
|
||||
export function setupCustomHover(hoverDelegate: IHoverDelegate, htmlElement: HTMLElement, content: IUpdatableHoverContentOrFactory, options?: IUpdatableHoverOptions): IUpdatableHover {
|
||||
htmlElement.setAttribute('custom-hover', 'true');
|
||||
|
||||
|
|
Loading…
Reference in a new issue