Skip to content

Commit

Permalink
feat(language-service): add provide generic to ServicePlugin type (#143)
Browse files Browse the repository at this point in the history
This allows a service plugin instance provide value to be inferred
without the need for an explicit type annotation on the create function.
  • Loading branch information
remcohaszing committed Feb 28, 2024
1 parent d7c5516 commit 410fa15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/language-service/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ export type Result<T> = T | Thenable<T>;
export type NullableResult<T> = Result<T | undefined | null>;
export type SemanticToken = [number, number, number, number, number];

export interface ServicePlugin {
export interface ServicePlugin<P = any> {
name?: string;
triggerCharacters?: string[];
signatureHelpTriggerCharacters?: string[];
signatureHelpRetriggerCharacters?: string[];
autoFormatTriggerCharacters?: string[];
create(context: ServiceContext): ServicePluginInstance;
create(context: ServiceContext): ServicePluginInstance<P>;
}

export interface EmbeddedCodeFormattingOptions {
Expand Down

0 comments on commit 410fa15

Please sign in to comment.