PhpStorm使用{大括号}而不是“引号”自动完成HTML属性。 [英] PhpStorm auto-completing HTML attributes with {braces} instead of "quotation marks"

查看:290
本文介绍了PhpStorm使用{大括号}而不是“引号”自动完成HTML属性。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题



我最近升级到最新的PhpStorm(或最近的最新版本

  PhpStorm 2017.2.4 
Build#PS-172.4155.41,建于2017年9月15日

既然这样做,任何时候我输入一个带有属性的HTML标签,比如

 < td class = 

它会自动完成它的JSX风格,并带有大括号,如下所示:

 < td class = {} 

期望的功能

它用于用引号自动完成它,如下所示:

 < td class =

我希望它能再次做到这一点。



警告



我可以通过禁用引号标记完成设置禁用大括号完成,但是当然,我没有得到引号也是。





问题



有没有这样的设置,我可以继续使引号自动完成,而不需要{大括号}完成?

$ b $如果您在JavaScript设置中将 React JSX 设置为默认语言级别,则会发生这种情况(<$ c $ c>设置/首选项|语言&框架| JavaScript )。



问题已解决( WEB-28894 )in 2017.3 EAP构建



对于2017.2.x版本 - 您必须使用不同的JavaScript语言级别。






2017.3.1 中引入了独立选项来控制此行为: https://blog.jetbrains.com/webstorm/2017/12/webstorm-2017-3-1/


Problem

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

Since doing this, any time I type a HTML tag with an attribute, such as

<td class=

it auto-completes it JSX style, with curly braces, like so:

<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?

解决方案

It happens if you have React JSX as default language level in the JavaScript settings (Settings/Preferences | Languages & Frameworks | JavaScript).

The problem is fixed (WEB-28894) in 2017.3 EAP builds.

For 2017.2.x builds -- you will have to use different JavaScript Language Level.


Separate option was introduced in 2017.3.1 to control this behaviour: https://blog.jetbrains.com/webstorm/2017/12/webstorm-2017-3-1/

这篇关于PhpStorm使用{大括号}而不是“引号”自动完成HTML属性。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆