volarjs / volar.js

💙🌊
https://volarjs.dev/
MIT License
970 stars 47 forks source link

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

Closed remcohaszing closed 6 months ago

remcohaszing commented 6 months ago

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 commented 6 months ago

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.