简体   繁体   English

PhpStorm使用{大括号}而不是“引号”自动完成HTML属性

[英]PhpStorm auto-completing HTML attributes with {braces} instead of “quotation marks”

Problem 问题

I've recently upgraded to the latest PhpStorm (or what was the latest recently.) 我最近升级到最新PhpStorm(或什么最新的最近。)

PhpStorm 2017.2.4
Build #PS-172.4155.41, built on September 15, 2017

Since doing this, any time I type a HTML tag with an attribute, such as 这样做以来,我每次输入带有属性的HTML标记,例如

<td class=

it auto-completes it JSX style, with curly braces, like so: 它使用花括号自动完成JSX样式,如下所示:

<td class={}

Desired functionality 所需功能

It used to auto-complete it with quotation marks, like so: 它曾经用引号自动完成它,如下所示:

<td class=""

And I'd like it to do this again. 我希望它再次执行此操作。

Caveat 警告

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. 我可以通过禁用引号完成设置来禁用花括号完成,但是,当然,我也不会得到引号。

在此处输入图片说明

Question

Is there a setting such that I can keep getting the "quotation mark" auto-complete, without getting the {curly brace} completion? 是否有设置可以使我自动保持“引号”的完成,而无需完成{curly brace}?

It happens if you have React JSX as default language level in the JavaScript settings ( Settings/Preferences | Languages & Frameworks | JavaScript ). 如果您在JavaScript设置( Settings/Preferences | Languages & Frameworks | JavaScript )中将React JSX作为默认语言级别,则会发生这种情况。

The problem is fixed ( WEB-28894 ) in 2017.3 EAP builds . 该问题已在2017.3 EAP版本中修复( WEB-28894 )。

For 2017.2.x builds -- you will have to use different JavaScript Language Level. 对于2017.2.x版本-您将必须使用其他JavaScript语言级别。


Separate option was introduced in 2017.3.1 to control this behaviour: https://blog.jetbrains.com/webstorm/2017/12/webstorm-2017-3-1/ 2017.3.1中引入了单独的选项来控制此行为: https : //blog.jetbrains.com/webstorm/2017/12/webstorm-2017-3-1/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM