Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect include exclude files options in tsconfig #2371

Merged
merged 3 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
- 🙌 Fix undefined valueDeclaration in props crashing vls. Thanks to contribution from [@javiertury](https://github.com/javiertury). #2367.
- 🙌 Reduce recreate ts program when no need for ts perf. Thanks to contribution from [@yoyo930021](https://github.com/yoyo930021). #2192 and #2328.
- 🙌 Display VTI errors. Thanks to contribution from [@yoyo930021](https://github.com/yoyo930021). #2324 and #2330.
Expand Down
13 changes: 13 additions & 0 deletions server/src/services/typescriptService/serviceHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,19 @@ 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);
projectVersion++;
Expand Down
2 changes: 1 addition & 1 deletion test/lsp/features/completion/script.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe.only('Should autocomplete for <script>', () => {

it('completes literal string', async () => {
await testCompletion(literalUri, position(3, 6), ['black', 'blue']);
})
});

it('completes optional properties in object', async () => {
await testCompletion(kindModifiersUri, position(12, 8), [{ label: 'b?', insertTextValue: '?.b' }]);
Expand Down