You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Visual Studio 2017中TypeScript代码无法使用Ctrl+E,D格式化

Fixing Ctrl+E,D Formatting Error in TypeScript (VS2017 Enterprise 15.6.4 with VC# 2005 Shortcuts)

It sounds like your keyboard shortcut bindings got messed up after the system reinstall—since you could format TypeScript code before, this is almost certainly a configuration issue rather than a core bug. Here's how to resolve it step by step:

1. Verify and Fix Shortcut Bindings

The error means the Format Document command isn't properly mapped to Ctrl+E,D for TypeScript files in your VC# 2005 shortcut scheme. Let's correct that:

  • Open Tools > Options > Environment > Keyboard
  • In the "Show commands containing" box, type Edit.FormatDocument
  • In the "Use new shortcut in" dropdown, select Text Editor (or specifically TypeScript Editor if you want it scoped only to TS files)
  • Click inside the "Press shortcut keys" box, then press Ctrl+E, release both, then press D
  • Click Assign to save the binding, then hit OK to close the options window.

2. Ensure TypeScript Language Services Are Installed and Enabled

A system reinstall might have missed some VS components needed for TypeScript formatting:

  • Open the Visual Studio Installer from your Start menu
  • Select your VS2017 Enterprise installation, then click Modify
  • Check that the ASP.NET and Web Development workload is installed (this includes TypeScript support)
  • If it's missing, select it and click Modify to install. Once done, restart VS.
  • Also, double-check formatting is enabled for TypeScript: Go to Tools > Options > Text Editor > TypeScript > Formatting and ensure all formatting options are toggled on.

3. Repair Your Visual Studio Installation

If the above steps don't work, a corrupted VS installation could be the culprit:

  • Open the Visual Studio Installer again
  • Select your VS2017 installation, click More > Repair
  • Let the repair process run (this might take a while), then restart your computer and launch VS again.

After trying these steps, test Ctrl+E,D in a TypeScript file—your formatting should work as it did before the system reinstall.

内容的提问来源于stack exchange,提问作者Erez Shlomo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 03:33:29