From e6795e2c2c1fbba255c88004f715c521585cdf30 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Thu, 25 Apr 2024 12:19:34 +0200 Subject: [PATCH] fix: revert waiting for config request in ts plugin The change in #2317 to wait for the "enable" request the extension sends lead to all TS files that use Svelte files and part of the initial tsconfig files getting all kinds of type errors because they were already loaded before the enable kicks in --- packages/typescript-plugin/src/config-manager.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/typescript-plugin/src/config-manager.ts b/packages/typescript-plugin/src/config-manager.ts index 4efd9a019..6db5c825a 100644 --- a/packages/typescript-plugin/src/config-manager.ts +++ b/packages/typescript-plugin/src/config-manager.ts @@ -30,12 +30,13 @@ export class ConfigManager { } updateConfigFromPluginConfig(config: Configuration) { - const shouldWaitForConfigRequest = config.global == true; - const enable = config.enable ?? !shouldWaitForConfigRequest; + // TODO this doesn't work because TS will resolve/load files already before we get the config request, + // which leads to TS files that use Svelte files getting all kinds of type errors + // const shouldWaitForConfigRequest = config.global == true; + // const enable = config.enable ?? !shouldWaitForConfigRequest; this.config = { ...this.config, - ...config, - enable + ...config }; this.emitter.emit(configurationEventName, config); }