Skip to content

Commit

Permalink
fix(language-server): add typescript and locale initialization options
Browse files Browse the repository at this point in the history
This allows people to load TypeScript as suggested in #140. Since
`initializationOptions` is of type `any` there, it doesn’t really
matter. But the `InitializationOptions` interface is used by the test
utils and prohibits the user from passing additional properties.

Also it’s nice if all Volar based language servers that do allow the
client to pass the TypeScript SDK, do so in a consistent manner.
  • Loading branch information
remcohaszing committed Feb 26, 2024
1 parent 09e1792 commit 379b228
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/language-server/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@ export enum DiagnosticModel {
}

export interface InitializationOptions {
typescript?: {
/**
* Absolute path to node_modules/typescript/lib, available for node
*/
tsdk?: string;
};
l10n?: {
location: string; // uri
};
diagnosticModel?: DiagnosticModel;
locale?: string;
maxFileSize?: number;
/**
* Extra semantic token types and modifiers that are supported by the client.
Expand Down

0 comments on commit 379b228

Please sign in to comment.