From 3b03c147c76b85c57bddbf9dc013669b9acb82dd Mon Sep 17 00:00:00 2001 From: yoyo930021 Date: Sat, 10 Oct 2020 18:38:21 +0800 Subject: [PATCH 1/2] Respect include exclude files options in tsconfig --- server/src/services/typescriptService/serviceHost.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/src/services/typescriptService/serviceHost.ts b/server/src/services/typescriptService/serviceHost.ts index c4a08c0b5e..1f7b3f86f8 100644 --- a/server/src/services/typescriptService/serviceHost.ts +++ b/server/src/services/typescriptService/serviceHost.ts @@ -195,6 +195,18 @@ export function getServiceHost( // External Documents: JS/TS, non Vue documents function updateExternalDocument(fileFsPath: string) { + // respect tsconfig + // use *internal* function + const configFileSpecs = (parsedConfig as any).configFileSpecs; + const isExcludedFile = (tsModule as any).isExcludedFile; + if ( + isExcludedFile && configFileSpecs && + isExcludedFile(fileFsPath, configFileSpecs, workspacePath, true, workspacePath) + ) { + return; + } + logger.logInfo(`update ${fileFsPath} in ts language service.`); + const ver = versions.get(fileFsPath) || 0; versions.set(fileFsPath, ver + 1); From 4c4e63cfca675796a1a1a98ee5e102b81c75497f Mon Sep 17 00:00:00 2001 From: yoyo930021 Date: Sat, 10 Oct 2020 18:41:39 +0800 Subject: [PATCH 2/2] CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4b800b1a0..a5ac3a91e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Upgrade `@prettier/plugin-pug` to fix formatter issues. #2347. - Fix files with CRLF having errors with wrong range. #1319. - 🙌 Fix collapse code missing end mark. Thanks to contribution from [@yoyo930021](https://github.com/yoyo930021). #2303 and #2352. +- 🙌 Respect include exclude files options in tsconfig for ts js external files. Thanks to contribution from [@yoyo930021](https://github.com/yoyo930021). #2339 and #2371. ### 0.28.0 | 2020-09-23 | [VSIX](https://marketplace.visualstudio.com/_apis/public/gallery/publishers/octref/vsextensions/vetur/0.28.0/vspackage)