如何格式化花括号以自动格式化intellij

编程入门 行业动态 更新时间:2024-10-06 22:21:11
本文介绍了如何格式化花括号以自动格式化intellij的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

每当我点击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

本文发布于:2023-05-28 00:47:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/308239.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:括号   intellij

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!