相关疑难解决方法(0)

Visual Studio Code Typescript 避免在新行上使用参数

我正在 Visual Studio Code 上开发一个 Angular 项目,并且在 Typescript 文件上遇到一个烦人的格式文档设置,它将参数中断为新行:

格式化之前(alt+shift+f):

this.opportunityId = this.route.snapshot.paramMap.get('opportunityid');
this.opportunityTermVendorId = this.route.snapshot.paramMap.get('vendorid');
this.opportunityTermVendorAssetId = this.route.snapshot.paramMap.get('assetid');
this.opportunityTermCollateralId = this.route.snapshot.paramMap.get('collateralid');
Run Code Online (Sandbox Code Playgroud)

格式化后(alt+shift+f):

this.opportunityId = this.route.snapshot.paramMap.get('opportunityid');
this.opportunityTermVendorId = this.route.snapshot.paramMap.get('vendorid');
this.opportunityTermVendorAssetId = this.route.snapshot.paramMap.get(
  'assetid'
);
this.opportunityTermCollateralId = this.route.snapshot.paramMap.get(
  'collateralid'
);
Run Code Online (Sandbox Code Playgroud)

我已关闭自动换行,但我仍然尝试将其设置为更大的自动换行列值。查看我当前的设置覆盖

{
   "git.confirmSync": false,
   "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
   "workbench.iconTheme": "material-icon-theme",
   "editor.formatOnSave": true,
   "prettier.singleQuote": true,
   "editor.wordWrapColumn": 180
 }
Run Code Online (Sandbox Code Playgroud)

typescript visual-studio-code angular

4
推荐指数
1
解决办法
4384
查看次数

标签 统计

angular ×1

typescript ×1

visual-studio-code ×1