Support link position in hover tooltip callback

This commit is contained in:
Jon Bockhorst
2019-10-14 14:25:02 -05:00
parent e224b865fd
commit 040f9f49d9
3 changed files with 37 additions and 4 deletions
+10 -2
View File
@@ -43,14 +43,22 @@ export interface IViewport extends IDisposable {
onThemeChange(colors: IColorSet): void;
}
export interface ILinkLocation {
startColumn: number;
startRow: number;
endColumn: number;
endRow: number;
}
export type LinkMatcherHandler = (event: MouseEvent, uri: string) => void;
export type LinkMatcherHoverTooltipCallback = (event: MouseEvent, uri: string, position: ILinkLocation) => void;
export type LinkMatcherValidationCallback = (uri: string, callback: (isValid: boolean) => void) => void;
export interface ILinkMatcher {
id: number;
regex: RegExp;
handler: LinkMatcherHandler;
hoverTooltipCallback?: LinkMatcherHandler;
hoverTooltipCallback?: LinkMatcherHoverTooltipCallback;
hoverLeaveCallback?: () => void;
matchIndex?: number;
validationCallback?: LinkMatcherValidationCallback;
@@ -96,7 +104,7 @@ export interface ILinkMatcherOptions {
/**
* A callback that fires when the mouse hovers over a link.
*/
tooltipCallback?: LinkMatcherHandler;
tooltipCallback?: LinkMatcherHoverTooltipCallback;
/**
* A callback that fires when the mouse leaves a link that was hovered.
*/