4

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.

enter image description here

Question

Is there a setting such that I can keep getting the "quotation mark" auto-complete, without getting the {curly brace} completion?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Alec
  • 1,986
  • 4
  • 23
  • 47
  • What's the JavaScript Language Level do you have selected for this project? – LazyOne Oct 26 '17 at 08:42
  • @LazyOne - Say no more. That was it, thanks! It had apparently defaulted to React JSX after the upgrade, possibly because it detected some React components in the project. – Alec Oct 26 '17 at 08:49

1 Answers1

5

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/

LazyOne
  • 158,824
  • 45
  • 388
  • 391
  • Perfect. This resolved my issue. To elaborate, this can be changed in `Settings | Languages & Frameworks | JavaScript`. Mine had been set to React JSX either automatically or by mistake. Setting it to `ECMAScript 6` and re-enabling the auto complete resolves the issue. – Alec Oct 26 '17 at 08:53