Inserting Closing Quote and Bracket
Hi,
Whenever a " or < is entered the corresponding closing tokens " or > should be inserted automatically for my custom language. I was looking into QuoteHandler but can't seem to make it work. I registered a quote handler and when I was debugging none of its methods were getting called. Is there any way to handle generic token types.
Cheers
Vishnu
Please sign in to leave a comment.
You can register an implementation of QuoteHandler, and you will find SimpleTokenSetQuoteHandler to be useful to extend.
Ensure you have registered it within your plugin.xml file with
<quoteHandler fileType="LanguageFileType" className="YourCustomQuoteHandlerFQCN"/>
You can also provide a BraceMatcher implementation. Implement PairedBraceMatcher, and provide your BracePair objects via getPairs. This will automatically complete your braces for you.
This can be registered via plugin.xml with
<lang.braceMatcher language="Language" implementationClass="YourBraceMatcherFQCN"/>
Hi Alan,
Seems like the bracemather doesn't insert matching tokens, It just highlights the mathched pair. I have overridden isPairedBracesAllowedBeforeType to return true but still not inserts the macthing pair. Am I missing out something here?
Sorry to resurrect a very old thread, however I too am having this issue and was wondering if a solution was eventually found?