7

When using backticks in a JavaScript file such as :

var name = 'Tom';
var greeting = `hello my name is ${name}`;

PhpStorm does all sorts of weird auto-formatting that breaks the file.

Backticks randomly appear or disappear, commenting the rest of the file. I've disabled the 'insert pair quotes' option in Settings but the problem still persists.

Is there a way to disable auto-formatting for backticks in PhpStorm version 2016.1.2?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Mister Fresh
  • 670
  • 1
  • 10
  • 22
  • Can you illustrate it with some gif image/screencast? In any case -- try **2016.2.1** -- http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program – LazyOne Aug 11 '16 at 18:22
  • Did you set the JavaScript Language Version for that project to ECMAScript 6 under `Preferences > Languages & Frameworks > JavaScript` – Derek Jan 13 '17 at 17:09
  • @LazyOne & Derek : Yes and yes. I opened an issue on the Jetbrains website. As far as I can remember they could not reproduce the problem. See my answer below. – Mister Fresh Jan 13 '17 at 17:48

2 Answers2

1

I have the same Problem with template strings. In the example, I added a backtick and it disappears when moving the cursor. Not if you use the mouse. example gif

My current workaround is to use normal concatenation and let PhpStorm convert it by clicking on the lightbulb.

0

I temporarily switched to using Sublime Text because my Macbook Air's 4 GB of RAM were not enough for Phpstorm.

The backtick problem still occurs with Sublime Text.

This makes me think that the problem is more related to OS X than Phpstorm.

Also the developer from Jetbrains was not able to reproduce the problem when I posted a bug there.

Because of the Macbook Pro 2016 debacle, I switched back to windows and the problem does not occur anymore for me. If anyone has a better answer I will update this.

Mister Fresh
  • 670
  • 1
  • 10
  • 22