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 using TypeScript version specified by project #1308

Merged

Conversation

PyvesB
Copy link
Contributor

@PyvesB PyvesB commented Aug 14, 2023

Until now, the TypeScript version was systematically being overridden to point to the one packaged with Eclipse. This meant that if your project relied on a different version of TypeScript (as specified in package.json for example), there was a risk of incompatibilities. Even worse, custom type definitions brought in third party dependencies were not resolved properly, for example in the case of React.js:
Screenshot 2023-08-14 at 12 17 04

VSCode allows switching between either its own version of TypeScript, or the one specified by the project, as described here:
https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-the-workspace-version-of-typescript

This PR adds similar support to Eclipse, via a preference page option. The default is the same as before, i.e. TypeScript packaged with Eclipse, so the behaviour for current Eclipse users will not change.

Tested on a project locally, all type definition resolution errors go away, and you can see the version that is being picked up by referring to the log messages produced by the language server at startup (as documented here).

With the Eclipse version:

Typescript Server version info: {version=5.0.4, source=user-setting}

With the Project version:

Typescript Server version info: {version=5.0.2-sdk, source=workspace}

Copy link
Contributor

@vrubezhny vrubezhny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the inline comment.

Signed-off-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>
Copy link
Contributor

@vrubezhny vrubezhny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks!

@vrubezhny vrubezhny merged commit feb5230 into eclipse-wildwebdeveloper:master Aug 15, 2023
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.

2 participants