How the insertion of closing quote works in Javascript plugin.
Hi,
When typing " in JavaScript IDEA automatically inserts the closing ". Unfortunately this doesn't work in my language plugin and I can't find how to configure it. Any idea how it is done in JavaScript?
Is there any other support for pairs of characters than PairedBraceMatcher?
Thanks,
galiley
Please sign in to leave a comment.
The JavaScript plugin uses the JSHtmlBridge cheater to do the cool things. See com.intellij.codeInsight.editorActions.TypedHandler#registerQuoteHandler(), but be aware, it's not part of the OpenAPI.
Sascha
It's as easy as implementing QuoteHandler EP, like this:
https://www.javatips.net/api/Grammar-Kit-master/src/org/intellij/grammar/editor/BnfQuoteHandler.java
Pay attention, that you need to include BAD_CHARACTER in the token set as well.