Pregunta

I am using Webstorm 7.0.3 to develop Node.Js. I have used Webstorm successfully for Html/Js apps, but for whatever reason, the code-coloring and error-highlighting does not exist in my Node.Js app that does for my Html/Js. For example, simple syntax errors don't highlight as desired.

You can see the difference in the two:

Html formatting:

Html Formatting

Node Formatting:

Node Formatting

While I know this is not a super critical thing, it makes it hard to debug as I code. Anyone know why it's different? I've searched Webstorms, but couldn't find anything.

Thanks in advance!

¿Fue útil?

Solución

Most likely the node_modules folder is added to javascript libraries (WebStorm prompts you to configure a library on project opening). Javascript files in libraries have the inspections and error/syntax highlighting turned off by default. You can still enable them for particular file using the Hector icon in the lower right corner (http://www.jetbrains.com/webstorm/webhelp/changing-highlighting-level-for-the-current-file.html)

Otros consejos

You can change your formatting this way:

var A = { foo: 'bar'
        , forgotThatComma: false
        }

So if you ever miss a comma, it would be obvious (see npm style guide for details).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top