Allow using TypeScript version specified by project #1308
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: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:
With the Project version: