Visual Studio 2015 RTM - 更新 TypeScript 工具后失去对 JavaScript 的支持
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31888115/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio 2015 RTM - Lost JavaScript support after update TypeScript Tools
提问by Augusto Barreto
I have lost the support for JavaScript files inside Visual Studio 2015 after updating the TypeScript tools from version 1.5.3 to 1.5.4.
在将 TypeScript 工具从版本 1.5.3 更新到 1.5.4 后,我失去了对 Visual Studio 2015 中 JavaScript 文件的支持。
By support for JavaScript I mean intellisense, syntax coloring and the JavaScript options inside Options menu -> Text Editor.
对 JavaScript 的支持是指智能感知、语法着色和选项菜单 -> 文本编辑器中的 JavaScript 选项。
My js files look like txt files now.
我的 js 文件现在看起来像 txt 文件。
I have already tried many things:
我已经尝试了很多东西:
- The steps in this answer: Visual Studio 2015 CTP - Javascript support missing
- Repair TypeScript Tools
- Repair Microsoft Asp.Net and Web Tools 2015
- Repair entire Visual Studio 2015
- 此答案中的步骤:Visual Studio 2015 CTP - Javascript support missing
- 修复 TypeScript 工具
- 修复 Microsoft Asp.Net 和 Web Tools 2015
- 修复整个 Visual Studio 2015
Nothing worked.
没有任何效果。
Does anyone knows a solution for this problem?
有谁知道这个问题的解决方案?
回答by Michael Braude
This is a known bug that we have fixed in VS 2015, however you could have been affected if you installed the "Universal Windows App Development Tools" during a specific period of time. We will soon be publishing a KB with the following workaround:
这是我们在 VS 2015 中修复的已知错误,但是如果您在特定时间段内安装了“通用 Windows 应用程序开发工具”,您可能会受到影响。我们将很快发布具有以下解决方法的知识库:
If the “Universal Windows App Development Tools” are still installed:
如果仍然安装了“通用 Windows 应用程序开发工具”:
- Go to Programs and Features, select Visual Studio 2105, click Change.
- In Visual Studio setup, click Modify.
- Deselect the feature “Universal Windows App Development Tools”
- Select “Universal Windows App Development Tools” again, and click Update.
- 转到程序和功能,选择 Visual Studio 2105,单击更改。
- 在 Visual Studio 安装程序中,单击修改。
- 取消选择“通用 Windows 应用程序开发工具”功能
- 再次选择“Universal Windows App Development Tools”,然后单击“更新”。
If you have already uninstalled the “Universal Windows App Development Tools”:
如果您已经卸载了“Universal Windows App Development Tools”:
- Reinstall “Universal Windows App Development Tools”
- Or, take the following steps to reinstall the JavaScript project system and language service:
- Download the installer for your edition of Visual Studio, e.g.
vs_community.exe
. - Open a CMD window, and run the following command:
vs_community.exe /modify /installselectableitems JavaScript_Hidden /passive
- Download the installer for your edition of Visual Studio, e.g.
- 重新安装“通用 Windows 应用程序开发工具”
- 或者,按照以下步骤重新安装 JavaScript 项目系统和语言服务:
- 下载适用于您的 Visual Studio 版本的安装程序,例如
vs_community.exe
. - 打开 CMD 窗口,然后运行以下命令:
vs_community.exe /modify /installselectableitems JavaScript_Hidden /passive
- 下载适用于您的 Visual Studio 版本的安装程序,例如
Sorry for the trouble. Hope that helps.
抱歉,添麻烦了。希望有帮助。
回答by Augusto Barreto
Found a workaround to rollback to TypeScript 1.5.3 and get back support for JS:
找到了回滚到 TypeScript 1.5.3 并重新支持 JS 的解决方法:
- From Programs and Features, uninstall TypeScript Tools 1.5.4 and Microsoft Asp.Net and Web Tools 2015
- Download VS 2015 offline installer (Reference: How to install VS2015 Community Edition offline)
- Inside the download directory from step 2, navigate to "packages\WPT" and install "webtoolsextensionsvs14.msi" (Microsoft Asp.Net and Web Tools 2015)
- Then navigate to the folder (inside the download directory) "OfflineCache\installers". You will see two TS folders: "TypeScriptV1" and "TypeScriptV2". They are the installers for the versions 1.5.3 and 1.5.4 respectively.
- Install TypeScript Tools 1.5.3 (using the installer inside the folder "TypeScriptV1")
- 从程序和功能中,卸载 TypeScript Tools 1.5.4 和 Microsoft Asp.Net and Web Tools 2015
- 下载VS 2015离线安装程序(参考:如何离线安装VS2015社区版)
- 在第 2 步的下载目录中,导航到“packages\WPT”并安装“webtoolsextensionsvs14.msi”(Microsoft Asp.Net and Web Tools 2015)
- 然后导航到文件夹(在下载目录内)“OfflineCache\installers”。您将看到两个 TS 文件夹:“TypeScriptV1”和“TypeScriptV2”。它们分别是 1.5.3 和 1.5.4 版本的安装程序。
- 安装 TypeScript Tools 1.5.3(使用文件夹“TypeScriptV1”内的安装程序)
Now, start Visual Studio. At this point JavaScript support should be back, and TS support still available.
现在,启动 Visual Studio。此时 JavaScript 支持应该回来了,并且 TS 支持仍然可用。
NOTE: there is no independent installer for TypeScript Tools for VS 2015(Reference: Typescript 1.5 for VS2015 without internet access)
注意:没有用于 VS 2015 的TypeScript 工具的独立安装程序(参考:Typescript 1.5 for VS2015 without internet access)
UPDATE:
更新:
As Mohamed Hegazy noted, the TypeScript installers are available to download on: TypeScript for Visual Studio 2015
正如 Mohamed Hegazy 所指出的,TypeScript 安装程序可以在以下位置下载:TypeScript for Visual Studio 2015
回答by Monah
In my case, here is the way I fixed it:
就我而言,这是我修复它的方式:
Tools > Options > Text Editor > JavaScript > Intellisense > References
工具 > 选项 > 文本编辑器 > JavaScript > Intellisense > 参考
- Make sure you Implicit (Web) is selected under Reference Group
- Make sure that
~/Scripts/references.js
is added in the include files list
- 确保在参考组下选择了隐式(Web)
- 确保
~/Scripts/references.js
已添加到包含文件列表中
Hope it will help you
希望它会帮助你