From 6cfb0d23df2c60d88ed1064b1127d7eb1767c303 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:23:54 +0200 Subject: [PATCH] fix: revert waiting for config request in ts plugin (#2352) 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); }