Skip to content

Commit fbc4b82

Browse files
committed
chore: make validForScope optional
1 parent 65c3b3e commit fbc4b82

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

types-packages/datatip.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type PinnedDatatipPosition = "end-of-line" | "above-range"
2121

2222
export interface DatatipProvider {
2323
priority: number
24-
grammarScopes?: ReadonlyArray<string>
24+
2525
/**
2626
* A unique name for the provider to be used for analytics.
2727
* It is recommended that it be the name of the provider's package.
@@ -37,7 +37,11 @@ export interface DatatipProvider {
3737
mouseEvent?: MouseEvent | null
3838
): Promise<Datatip | undefined | null>
3939

40-
validForScope(scopeName: string): boolean // should be optional?
40+
/** Either pass this or `validForScope` */
41+
grammarScopes?: ReadonlyArray<string>
42+
43+
/** Either pass `grammarScopes` or this function. */
44+
validForScope?(scopeName: string): boolean
4145
}
4246

4347
export interface ModifierDatatipProvider {

0 commit comments

Comments
 (0)