scztt / LanguageServer.quark

16 stars 10 forks source link

Formatting provider: Defer initialization into a StartUp block #18

Closed jamshark70 closed 5 months ago

jamshark70 commented 10 months ago

If TextDocumentFormattingProvider is initialized immediately, then the user has no opportunity to configure formatterEnabled in startup.scd. The user should not be required to edit class definitions by hand for configuration. Putting the actual creation of the CodeFormatter object into a StartUp block means that startup.scd runs first, and then the formatterEnabled check happens later.

I haven't done a comprehensive review of the other providers to look for other configuration options that need similar treatment.