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

Allow extension contributed TS plugins to be loaded for workspace versions of TS #65031

Closed
mjbvz opened this issue Dec 13, 2018 · 5 comments
Closed
Assignees
Labels
api typescript Typescript support issues verification-needed Verification of issue is requested verified Verification succeeded

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Dec 13, 2018

Background
Extension contributed typescript plugins are currently only loaded when you are using the bundled version of TS. This is done for compatibility reasons: a malfunctioning ts plugin can break all intellisense and we were concerned that many plugins may not be compatible with older versions of TS that users have installed in their workspace.

The current solution requires that users install the plugin in their workspace if they are using a workspace version of TS

Proposed fix

  1. TS plugins should check the TS version at run time and not enable themselves if the TS version is too old

  2. We will add a enableForWorkspaceTypeScriptVersions flag to the plugins contribution section. This opt-in flag will allow the plugin to be loaded when using workspace versions of TS. Only plugins that do part 1 should set this flag

@mjbvz mjbvz added api typescript Typescript support issues labels Dec 13, 2018
@mjbvz mjbvz added this to the December 2018 milestone Dec 13, 2018
@mjbvz mjbvz self-assigned this Dec 13, 2018
@mjbvz
Copy link
Contributor Author

mjbvz commented Dec 13, 2018

/cc @minestarks

@mjbvz mjbvz closed this as completed in 6b89247 Dec 13, 2018
@minestarks
Copy link
Member

Thanks!

@cyrilletuzi
Copy link

cyrilletuzi commented Jan 13, 2019

@mjbvz Is there an example somewhere of how to do part 1?

Also, I was thinking of the opposite issue: a newer bundled version of TypeScript could break a plugin too. For example, Angular comes with the TypeScript plugin @angular/language-service, but Angular supporting newer versions of TypeScript takes more time than VS Code. What's your advice for this case?

@mjbvz
Copy link
Contributor Author

mjbvz commented Jan 15, 2019

@cyrilletuzi https://github.com/Microsoft/typescript-tslint-plugin/blob/bc764d9147cf4ced67a401c41009882c289bcdc2/src/index.ts#L39

We now use the typescript.version (3.3) instead of the servicesVersion (0.8) as in discussions with the TS team, they were not confident that servicesVersion was actually any more reliable than the user facing version number

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 28, 2019
@mjbvz mjbvz added the verification-needed Verification of issue is requested label Jan 28, 2019
@mjbvz
Copy link
Contributor Author

mjbvz commented Jan 28, 2019

To verify:

  1. Install https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin
  2. In a workspace, switch to using a workspace version of TypeScript (3.1+)
  3. Verify that tslint errors are still reported without needing any extra configuration

@roblourens roblourens added the verified Verification succeeded label Jan 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api typescript Typescript support issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants