IntelliJ IDEA and backticks (`)

In our environment, we are writing a Javascript template in which there are areas where server preprocessing inserts values ​​into the code.

An example would look like this:

var myVarValue = "`serverProcessedVarValue()`"; 

In the above example, the server performs a function that is unmanned by back windows, and writes the result between quotation marks, and then sends this javascript to the browser.

We use IntelliJ IDEA. He (and Webstorm, I suppose) emphasizes these reverse steps as an encoding error. I can not find the settings to change this behavior. There is one?

Thanks!

+5
source share
2 answers

There is no such setting. IntelliJ IDEA creates a complete syntax tree for the file you are editing, and all of its functions rely on the full syntax tree. Because of this, it is impossible to tell him to ignore certain characters - he did not know how to analyze the remaining code and how to check the resulting syntax tree.

What you can do is either write a plugin to analyze your specific JavaScript taste with templates, or change the syntax you use to match one of the template languages ​​already supported by IntelliJ IDEA.

+1
source

Backtick is supported in ES6 for multi-line, and WebStorm has JavaScript language settings. Changing it to ES6 will change this behavior.

+5
source

All Articles