Skip to content

fix(test-utils): allow unknown initialization options and expose locale option#142

Merged
johnsoncodehk merged 2 commits intomasterfrom
restore-typescript-initialization-option
Feb 28, 2024
Merged

fix(test-utils): allow unknown initialization options and expose locale option#142
johnsoncodehk merged 2 commits intomasterfrom
restore-typescript-initialization-option

Conversation

@remcohaszing
Copy link
Member

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.

remcohaszing and others added 2 commits February 26, 2024 13:50
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.
@johnsoncodehk
Copy link
Member

johnsoncodehk commented Feb 28, 2024

Thanks! I modified the API to accept unknown properties. Also corrected is that locale should be a property of InitializeParams instead of InitializeParams.initializationOptions.

I think whether to keep typescript.tsdk as an optional convention needs to be discussed first, so I temporarily reverted the changes to the initializationOptions interface.

@johnsoncodehk johnsoncodehk changed the title fix(language-server): add typescript and locale initialization options fix(test-utils): allow any initialization option properties and expose locale option Feb 28, 2024
@johnsoncodehk johnsoncodehk changed the title fix(test-utils): allow any initialization option properties and expose locale option fix(test-utils): allow unknown initialization options and expose locale option Feb 28, 2024
@johnsoncodehk johnsoncodehk merged commit d7c5516 into master Feb 28, 2024
@johnsoncodehk johnsoncodehk deleted the restore-typescript-initialization-option branch February 28, 2024 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants