Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm - Backticks ` for ES6 template strings broken

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?

like image 685
Mister Fresh Avatar asked Aug 11 '16 17:08

Mister Fresh


1 Answers

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.

like image 187
Ben Richter Avatar answered Oct 02 '22 08:10

Ben Richter