PhpStorm 使用 {braces} 而不是“引号"自动完成 HTML 属性; [英] PhpStorm auto-completing HTML attributes with {braces} instead of "quotation marks"
问题描述
问题
我最近升级到了最新的 PhpStorm(或者是最近的最新版本.)
I've recently upgraded to the latest PhpStorm (or what was the latest recently.)
PhpStorm 2017.2.4
Build #PS-172.4155.41, built on September 15, 2017
自从这样做之后,任何时候我输入一个带有属性的 HTML 标签,比如
Since doing this, any time I type a HTML tag with an attribute, such as
<td class=
它自动完成 JSX 样式,使用花括号,如下所示:
it auto-completes it JSX style, with curly braces, like so:
<td class={}
想要的功能
它曾经用引号自动完成它,如下所示:
It used to auto-complete it with quotation marks, like so:
<td class=""
我希望它再次这样做.
警告
我可以通过禁用引号完成设置来禁用大括号完成,但当然,我也没有得到引号.
I'm able to disable the curly brace completion by disabling quotation mark completion setting, but of course, I don't get the quotation marks either.
问题
是否有设置可以让我继续获得引号"自动完成,而无需获得{花括号}完成?
Is there a setting such that I can keep getting the "quotation mark" auto-complete, without getting the {curly brace} completion?
推荐答案
如果您在 JavaScript 设置中将 React JSX
作为默认语言级别(Settings/Preferences | Languages &框架 | JavaScript
).
It happens if you have React JSX
as default language level in the JavaScript settings (Settings/Preferences | Languages & Frameworks | JavaScript
).
问题已在 WEB-28894 中解决(2017.3 EAP 构建.
The problem is fixed (WEB-28894) in 2017.3 EAP builds.
对于 2017.2.x 版本——您将不得不使用不同的 JavaScript 语言级别.
For 2017.2.x builds -- you will have to use different JavaScript Language Level.
在 2017.3.1 中引入了单独的选项来控制此行为:https://blog.jetbrains.com/webstorm/2017/12/webstorm-2017-3-1/
Separate option was introduced in 2017.3.1 to control this behaviour: https://blog.jetbrains.com/webstorm/2017/12/webstorm-2017-3-1/
这篇关于PhpStorm 使用 {braces} 而不是“引号"自动完成 HTML 属性;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!