From 28f75e9a758e6cde3da9332536f615712c7a5a2e Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Wed, 17 Aug 2022 14:23:53 +0200 Subject: [PATCH] (fix) always update files from .svelte-kit/types https://github.com/sveltejs/kit/issues/5940 --- .../src/plugins/typescript/TypeScriptPlugin.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/language-server/src/plugins/typescript/TypeScriptPlugin.ts b/packages/language-server/src/plugins/typescript/TypeScriptPlugin.ts index 14f3723af..8191a9e81 100644 --- a/packages/language-server/src/plugins/typescript/TypeScriptPlugin.ts +++ b/packages/language-server/src/plugins/typescript/TypeScriptPlugin.ts @@ -458,8 +458,14 @@ export class TypeScriptPlugin const declarationExtensions = [ts.Extension.Dcts, ts.Extension.Dts, ts.Extension.Dmts]; const canSafelyIgnore = declarationExtensions.every((ext) => !fileName.endsWith(ext)) && - ignoredBuildDirectories.some((dir) => dirPathParts.includes(dir)); - + ignoredBuildDirectories.some((dir) => { + const index = dirPathParts.indexOf(dir); + + return ( + // Files in .svelte-kit/types should always come through + index > 0 && (dir !== '.svelte-kit' || dirPathParts[index + 1] !== 'types') + ); + }); if (canSafelyIgnore) { continue; }