Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Community Edition: Javascript syntax highlighting

I'm using IntelliJ IDEA 12 Community Edition, and am trying to set the syntax coloring for Javascript files. When I choose File > Settings > IDE Settings > Editor > Colors & Fonts, Javascript is not an option in the list. Is this a limitation of the Community Edition IDE, or am I missing something? The others I need are listed, like Java and HTML, but Javascript is missing from the list.

Thanks.

like image 960
MegaMatt Avatar asked Sep 06 '13 15:09

MegaMatt


People also ask

Can you use JavaScript in IntelliJ Community Edition?

Since the Community Edition of IntelliJ doesn't natively support TypeScript or JavaScript, you may choose to include some available Enterprise plugins or purchase IntelliJ Ultimate.

How do I enable syntax highlighting in IntelliJ?

Enable semantic highlighting Press Ctrl+Alt+S to open the IDE settings and select Editor | Color Scheme | Language Defaults | Semantic highlighting. Select the Semantic highlighting checkbox and customize the color ranges if necessary.

How add JavaScript plugin to IntelliJ?

Press Ctrl+Alt+S to open the IDE settings and select Languages & Frameworks | JavaScript | Libraries. On the Settings: JavaScript Libraries page that opens, click Add. The New Library dialog opens. , and choose Attach File or Attach Directory from the list.

Does IntelliJ support JSP syntax highlighting?

IntelliJ supports JSP syntax highlighting, but strangely none of the syntax is predefined. It allows us to define the syntax though if you double click "JSP Files (syntax highlighting only)". The + / - buttons below allows to add keywords and 1 / 2 / 3 / 4 tabs give different syntax colours.

How do I add syntax highlighting in IntelliJ IDEA?

IntelliJ IDEA allows to manually add syntax highlighting settings in "Settings > File Types" even in the Community Edition BUT it ignores these settings after a restart. These settings are stored in the user's home directory at e.g. ~/.IdeaIC2016.1/config/filetypes/*.xml.

Does IntelliJ IDEA support JavaScript?

JavaScript support is supported in Ultimate Edition, but not in Community Edition. For the basic syntax highlighting you can try the TextMate Bundles Support plug-in. See this document for the setup instructions (it's for PhpStorm, but instructions for IntelliJ IDEA would be the same). Show activity on this post.

What is semantic highlighting in IntelliJ?

Semantic highlighting provides an additional coloring layer to improve the visual distinction of several related items (e.g., method parameters, local variables). Register RainbowVisitor in com.intellij.highlightVisitor extension point. Color Settings must implement RainbowColorSettingsPage in addition.


4 Answers

JavaScript support is supported in Ultimate Edition, but not in Community Edition.

For the basic syntax highlighting you can try the TextMate Bundles Support plug-in. See this document for the setup instructions (it's for PhpStorm, but instructions for IntelliJ IDEA would be the same).

like image 103
CrazyCoder Avatar answered Oct 19 '22 02:10

CrazyCoder


The TextMate Bundles Support plug-in in not enough. You also need specific language bundles.

  1. install and enabled the TextMate bundle support plugin in IntelliJ
  2. Download the specific language bundles and unzip them somewhere where you find them, e.g., TypeScript, Shell Script TextMate Bundle
  3. Open the Settings/Preferences dialog, got to Editor and select TextMate Bundles
  4. Click on the + on the right side and choose the desired bundle from 2. on your hard disk. Then it should appear in the list of recognized bundles.
  5. Extension conflicts might appear: Click on "Show details". If you want to use the new syntax highlighting click on "unregister native file type".

A detailed explanation with screenshots can be found here

like image 23
Judith Avatar answered Oct 19 '22 03:10

Judith


I found this question after searching by "how to enable JS syntax highlight into JSP files" in my Intellij Community Edition.

Following the suggestion to use TextMate Bundles, I checked that it's already installed by default, including JSP support (built-in). But it did not work.

So, I fixed it by just removing the "*.jsp" pattern from "File Types > JSP", and after that now my IDE is using TextMate syntax highlight properly.

like image 2
rogeriolino Avatar answered Oct 19 '22 03:10

rogeriolino


Use Visual Studio Code for Javascript support when using IntelliJ Community Edition. It's free and has all the support you would get for the paid version of IntelliJ Ultimate.

like image 1
Johann Avatar answered Oct 19 '22 04:10

Johann