volarjs / volar.js

💙🌊
https://volarjs.dev/
MIT License
963 stars 47 forks source link

fix(vscode): show error on missing TypeScript lib #195

Closed msujew closed 3 months ago

msujew commented 3 months ago

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 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 :)

johnsoncodehk commented 3 months ago

Look great! Thanks for following up!