每当我点击alt-cmd-l来自动格式化代码时,它都会从以下位置格式化我的导入和数组:
Whenever I hit alt-cmd-l to autoformat my code, it formats my imports and arrays from:
import { CommonModule } from '@angular/common'; let arr = [ myStringVar ]; // simple example, just go with it到
import {CommonModule} from '@angular/common'; let arr = [myStringVar];在自动格式化时,如何告诉IntelliJ在大括号后和大括号前放置一个空格? (专门用于javascript,打字稿)
How do I tell IntelliJ to put a space after the opening brace and before the close brace when auto-formatting? (Specifically for javascript, typescript)
我一直在寻找答案,却找不到一个答案或严重问了一个问题.因此,如果这是重复的话,我深表歉意.
I've looked around for the answer and could not find one or asked the question badly. So I apologize if this is duplicate.
我正在使用Intellij 2016.3.3
I'm on Intellij 2016.3.3
推荐答案转到设置并搜索ES6导入/导出括号.它应该带您进入编辑器->代码样式-> Javascript(或TypeScript).只需点击空格"选项卡上的复选框,它应将空格重新添加.
Go to settings and search for ES6 import/export braces. It should take you to Editor -> Code Style -> Javascript (or TypeScript). Just hit that checkbox on the spaces tab and it should add the spaces back.
更多推荐
如何格式化花括号以自动格式化intellij
发布评论