Moves the code away from the assumption that there's always a valid TypeScript distribution available under the ${appRoot}/extensions/node_modules/typescript/lib path. While I add this change specifically for Theia, there are other (improbable) cases in which the VS Code builtin TypeScript distribution might be malformed or simply unavailable.
I believe this change is breaking as getTsdk is exported from the main index and can now also return undefined in addition to the original object type.
Note that I'm not too familiar with the project and haven't found any instructions on testing the changes. If something doesn't work as expected, please let me know how I can test my changes before I request another review :)
Closes https://github.com/volarjs/volar.js/issues/122
Moves the code away from the assumption that there's always a valid TypeScript distribution available under the
${appRoot}/extensions/node_modules/typescript/lib
path. While I add this change specifically for Theia, there are other (improbable) cases in which the VS Code builtin TypeScript distribution might be malformed or simply unavailable.I believe this change is breaking as
getTsdk
is exported from the main index and can now also returnundefined
in addition to the original object type.Note that I'm not too familiar with the project and haven't found any instructions on testing the changes. If something doesn't work as expected, please let me know how I can test my changes before I request another review :)