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

fix(typescript): resolve the shim used for tsc in Typescript v5.7 and up #252

Merged
merged 6 commits into from
Dec 13, 2024

Conversation

kitsune7
Copy link
Contributor

@kitsune7 kitsune7 commented Dec 6, 2024

This PR resolves issue #251.

I made the checks for detecting whether or not tscPath is pointed at a shim as resistant to change as I could think to make them (without trying to parse an AST). Because we rely on Typescript's source code, there's always a chance that a future update could break things, but this should be fairly resilient.

I tested this on a local repository and have verified that it fixes the issue when using Typescript v5.7.2. It also maintains backwards compatibility for older Typescript versions that don't use a shim for tsc.

Copy link

pkg-pr-new bot commented Dec 13, 2024

Open in Stackblitz

@volar/eslint

npm i https://pkg.pr.new/volarjs/volar.js/@volar/eslint@252

@volar/jsdelivr

npm i https://pkg.pr.new/volarjs/volar.js/@volar/jsdelivr@252

@volar/kit

npm i https://pkg.pr.new/volarjs/volar.js/@volar/kit@252

@volar/language-core

npm i https://pkg.pr.new/volarjs/volar.js/@volar/language-core@252

@volar/language-server

npm i https://pkg.pr.new/volarjs/volar.js/@volar/language-server@252

@volar/language-service

npm i https://pkg.pr.new/volarjs/volar.js/@volar/language-service@252

@volar/monaco

npm i https://pkg.pr.new/volarjs/volar.js/@volar/monaco@252

@volar/source-map

npm i https://pkg.pr.new/volarjs/volar.js/@volar/source-map@252

@volar/test-utils

npm i https://pkg.pr.new/volarjs/volar.js/@volar/test-utils@252

@volar/typescript

npm i https://pkg.pr.new/volarjs/volar.js/@volar/typescript@252

@volar/vscode

npm i https://pkg.pr.new/volarjs/volar.js/@volar/vscode@252

commit: 8b061e3

@johnsoncodehk johnsoncodehk merged commit 57d8299 into volarjs:master Dec 13, 2024
5 checks passed
@johnsoncodehk
Copy link
Member

I made a few modifications to your approach. Thanks for look into this!

johnsoncodehk added a commit to vuejs/language-tools that referenced this pull request Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

runTsc breaks in Typescript v5.7 when providing extraSupportedExtensions
2 participants