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

[Feature Request] Support using nightly TypeScript #1332

Closed
tjx666 opened this issue May 23, 2022 · 12 comments · Fixed by #1629
Closed

[Feature Request] Support using nightly TypeScript #1332

tjx666 opened this issue May 23, 2022 · 12 comments · Fixed by #1629

Comments

@tjx666
Copy link
Contributor

tjx666 commented May 23, 2022

As we know, there is an extension JavaScript and TypeScript Nightly which enables the nightly build of TypeScript (typescript@next) as VS Code's built-in TypeScript version used to power JavaScript and TypeScript IntelliSense.

image

But now volar only support toggle typescript version between builtin and workspace version:

image

It would be helpful to support using the nightly typescript version. For example, I can using the latest got to source definition function comes with the latest typescript.

image

@tjx666
Copy link
Contributor Author

tjx666 commented Jul 20, 2022

Seems not work in latest version. @johnsoncodehk
Same with before.
image

@johnsoncodehk
Copy link
Member

@tjx666 What behavior are you expecting and it doesn't work?

@tjx666
Copy link
Contributor Author

tjx666 commented Jul 20, 2022

When I open .ts file, I can easily toggle to typescript version to ts4.8 with extension JavaScript and TypeScript Nightly by command TypeScript: Select TypeScript Version...

2022-07-20.16.41.51.mov

But when I open .vue file, using command Volar: Select TypeScript Version... can only select ts4.7:

image

@tjx666
Copy link
Contributor Author

tjx666 commented Jul 20, 2022

@johnsoncodehk So, how can I easily toggle ts version to 4.8. Seems I have to install 4.8 as dependency now.

@yaegassy
Copy link
Collaborator

yaegassy commented Jul 20, 2022

@tjx666 This "JavaScript and TypeScript Nightly" extention goes into the extension folder installed by the user.

Try setting typescript.tsdk in .vscode/settings.json. This is an example of my environment.

{
  "typescript.tsdk": "/Users/yaegassy/.vscode/extensions/ms-vscode.vscode-typescript-next-4.8.20220719/node_modules/typescript/lib",
}

You will probably see more items available for selection in "Use Workspace Version". Perhaps, but it is also
possible to use typescript/lib installed at an arbitrary location.

volar-issue-1332-1

(As a supplement, I have not checked the operation in detail.)

REF:

@tjx666
Copy link
Contributor Author

tjx666 commented Jul 20, 2022

I think volar can search the folder /Users/yaegassy/.vscode/extensions/ms-vscode.vscode-typescript-next-xxx/node_modules/typescript/lib and provide it in pick list.

JavaScript and TypeScript Nightly is the official recommend extension to using the latest typescript.

@yaegassy
Copy link
Collaborator

@tjx666 Are there any other VSCode extensions that support this?

@tjx666
Copy link
Contributor Author

tjx666 commented Jul 20, 2022

@tjx666 Are there any other VSCode extensions that support this?

Seems very few extensions will manage typescript version by themself.

@yaegassy
Copy link
Collaborator

If you are a user with a high technical level who uses TypeScript's Nightly, setting up typescript.tsdk is very very easy task. :)

typescript.tsdk can handle this, but if you need the feature you want ASAP, you may want to create a pull request.

I think this is the related code. (and there may be others)

@johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk reopened this Jul 20, 2022
@tjx666
Copy link
Contributor Author

tjx666 commented Jul 20, 2022

Ok, I will try to implement this and make a pr this weekend

@tjx666
Copy link
Contributor Author

tjx666 commented Jul 24, 2022

@johnsoncodehk @yaegassy any way to get currrent used ts version?

using clients[0].clientOptions.initializationOptions.typescript ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants