0

So, the question is as the title reads. I would greatly appreciate any help in understanding why could PhpStorm use different syntax highlighting colors in a .js file and .php file for JavaScript.

Contrary to the popular question of why js syntax highlighting doesn't work in .php files :)

I imported settings from PhpStorm 10 to 2016.3, but as I recall, version 10 had the same problem for me.

Here is how it looks:

enter image description here

As you can see, variable identifiers, function declaration, function calls, and other stuff is not highlighted correctly in the .js file, but looks just fine under <script> tags in .php files.

Here is a screenshot of Editor - Colors & Fonts - JavaScript:

enter image description here

According to this, everything is fine. But not in my .js files, where the bulk of work is :(

5
  • 2
    First screenshot, top right corner, it looks like code inspection/highlighting is off. Commented Dec 27, 2016 at 17:12
  • Wow, what the heck :D Thank you! Problem solved! Stackoverflow <3 Commented Dec 28, 2016 at 7:55
  • @JuanTonina any ideas how to set code inspection/highlighting to top level by default for .js files? For now i have to manually turn it on for each new .js file. No such problem with .php files. Commented Dec 28, 2016 at 13:03
  • 1
    make sure that your .js files are not located in excluded directory - inspections and highlighting are off for such files Commented Dec 28, 2016 at 14:38
  • @lena they are definitely not... Commented Dec 28, 2016 at 14:44

1 Answer 1

0

So it turns out, as Juan Tonina suggested in the comment to my question, code inspection/highlighting was off for .js files for some reason. Big thanks!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.