mjs
mjs

Reputation: 22357

Intellij plugin to recognize javascript in a tag

I am using a template library that our company has developed.

It is really great, however, we are using a tag:

<g:js> 

// javascript code

</g:js> 

This tag does some stuff but essentially that is javascript code with some objects passed to it at the client.

How can I get intellij to recognize this as javascript code? Right not it is being treated as plain text.

Upvotes: 0

Views: 75

Answers (1)

Darek Kay
Darek Kay

Reputation: 16669

You have to Inject language. To do that, move the cursor inside the tags (where your JS code is) and either:

  • Alt+Enter -> Inject Language -> JavaScript
  • Ctrl+Shift+A and type Inject language

After that you can customize injection settings using language injection settings (again, by using one of those methods).

Upvotes: 1

Related Questions