简体   繁体   English

无法在Visual Studio 2017 RC中添加全局JavaScript智能感知参考

[英]Cannot add a global JavaScript Intellisense reference in Visual Studio 2017 RC

I'm trying to make the migration over to 2017 from 2015 as painless as possible. 我试图尽可能轻松地从2015年开始迁移到2017年。 The codebase that I work with has a couple of custom libraries that I was able to add as references in VS 2015. 我使用的代码库有几个自定义库,我可以在VS 2015中添加它作为引用。

However, in VS 2017 RC, the 'references' option has been removed from the options->text editor->JavaScript/Typescript->Intellisense menu, where it was present in VS 2015. 但是,在VS 2017 RC中,'references'选项已从选项 - >文本编辑器 - > JavaScript / Typescript-> Intellisense菜单中删除,它存在于VS 2015中。

Any direction in getting this working would be greatly appreciated. 任何指导这项工作的人都会非常感激。

Be well 好吧

There is a change in js engine reflecting in intellisense as well. 在智能感知中,js引擎也有变化。 You might get more info and samples here and here . 您可能会在此处此处获得更多信息和示例。

HTH HTH

Ivo 伊沃

My understanding is that the new JavaScript language service, 'Salsa', is the culprit here. 我的理解是,新的JavaScript语言服务'Salsa'是这里的罪魁祸首。

This blog link (provided by i100) has the following statement under the Notable Changes section: 此博客链接 (由i100提供)在“显着更改”部分下面有以下声明:

Another key difference is that while the old language service supported an extensibility model that allowed custom extensions to be developed for specific 3rd party JavaScript libraries, Salsa no longer supports these extensions in favor of TypeScript definition files which encourage community collaboration and are easier to keep up-to-date. 另一个关键区别是,虽然旧语言服务支持可扩展性模型,允许为特定的第三方JavaScript库开发自定义扩展,但Salsa不再支持这些扩展,而是支持TypeScript定义文件,这些文件鼓励社区协作并且更容易跟上-至今。

While, the wording is somewhat ambiguous to me, I assume that this means that adding javaScript libraries as references directly is no longer supported in VS 2017. The only way to get Intellisense in VS 2017 is with a TypeScript definition file. 虽然这个措辞对我来说有些含糊不清,但我认为这意味着VS 2017中不再支持直接添加javaScript库作为参考。在VS 2017中获取Intellisense的唯一方法是使用TypeScript定义文件。

I found this question on how to generate TypeScript def files from existing JavaScript files. 我发现了关于如何从现有JavaScript文件生成TypeScript def文件的这个问题 The conventional wisdom is that TS def files require more specificity than JavaScript files, and therefore are most reliably created manually. 传统观点认为TS def文件需要比JavaScript文件更具特异性,因此最可靠地手动创建。 However this may not be a feasible solution if you are like me and have tens of thousands of lines of custom library definitions. 但是,如果您像我一样拥有成千上万行的自定义库定义,这可能不是一个可行的解决方案。

There are a couple of programs that will allegedly generate TS def files automatically, but I have never used them and cannot speak to their effectiveness. 据称有几个程序会自动生成TS def文件,但我从未使用它们,也无法说出它们的有效性。

dts-gen is created by Microsoft. dts-gen由Microsoft创建。

dts-generator is created by SitePen. dts-generator由SitePen创建。

It appears that the industry thinks that TypeScript is the way of the future, and are working hard to make TS development the standard. 业界似乎认为TypeScript是未来的发展方向,并且正在努力使TS开发成为标准。

i don't wanna know what microsoft thinks what will be "the future" they are eating dust for a long time. 我不想知道微软认为什么是“未来”他们正在长时间吃灰尘​​。 VS2017 don't support pure js intellisense anymore and i don't want to learn a language that "compiles" to javascript. VS2017不再支持纯js intellisense了,我不想学习一种“编译”到javascript的语言。

by the end i uninstalled VS2017 and keep with VS2015 until i research for something better. 到最后我卸载VS2017并与VS2015保持一致,直到我研究更好的东西。

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

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