简体   繁体   English

在Typescript和JavaScript中构建VS代码扩展

[英]Building VS Code Extensions in Typescript vs JavaScript

Are there any benefits of developing a Visual Studio Code extension in Typescript rather than JavaScript? 用Typescript而不是JavaScript开发Visual Studio Code扩展有什么好处? I've been searching for a comparison of the two (pros, cons, differences, etc) but have not been able to find that. 我一直在寻找两者的比较(优点,缺点,区别等),但找不到。

I would definitley use typescript. 我会definitley使用打字稿。 VSCode was made in typescript and it would be a good idea to use the same language they use. VSCode是用打字稿制作的,最好使用相同的语言。 The extension examples they offer are all in typescript. 他们提供的扩展示例全部在打字稿中。 Other people's extensions like my own or wolf or react-native or power-mode are also in typescript. 别人的扩展名,例如我自己的wolfreact-nativepower-mode ,也在打字稿中。 If you used javascript using other people's code would require converting it over which would be quite annoying. 如果您使用javascript使用其他人的代码,则需要对其进行转换,这会很烦人。

And of course there are all the benefits typescript provides over javascript: fail-fast compilation, better intellisense, less errors, etc... 当然,打字稿比javascript有很多好处:快速编译,更好的智能感知,更少的错误等。

What is TypeScript and why would I use it in place of JavaScript? 什么是TypeScript?为什么我要用它代替JavaScript?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM