10

Why JS variables have different colors in JetBrains WebStorm 2016 ? There are no significant differences between express, path, favicon... variables: I use them all in the code.

Do these colors mean something, is it normal behavior of WebStorm? If not - how to change them?

Variable colors in JetBrains WebStorm

Serob_b
  • 965
  • 12
  • 29

2 Answers2

10

The colours for those member fields are different because they are different types.

The fields coloured purple are object variables and the fields in light orange are function variables.

IntelliJ (or WebStorm) has determined this by examining the export field of the targeted JavaScript files.

See screenshots below:

Screenshot showing syntax highlight colour of JavaScript instance functions

Screenshot showing syntax highlight colour of JavaScript instance variables

Taylor Hx
  • 2,815
  • 23
  • 36
1

Open Settings/Preferences dialog, and under the File node, click Colors & Fonts and select JavaScript. From right panel you can change all the colors

It's important to note that the check box Use inherited attributes is selected!

For more detail go to this link

Change Colors

Ivan Barayev
  • 2,035
  • 5
  • 24
  • 30
  • 1
    For Global variable (my case) it is set to some color (`path` in my code has a such color) but my question is why other variables are shown with other colors? – Serob_b Jan 11 '17 at 00:39
  • Its about your installed color schema. If you wanna you can find different color schemas and install it on settings. – Ivan Barayev Jan 11 '17 at 00:44
  • Current schema is `Darcula`, but there isn't any information about variables' different colors in it. The only color `A9B7C6` is set. I changed schema to `Monokai` or `Cobalt` but in these cases they have different colors too. I don't see any logical difference between my variables, so why they should have different colors? I can guess that by mistake some of them are treated as a functions, so they have function's color... But it's not a solution. – Serob_b Jan 11 '17 at 00:56