0

I'm writing an IntelliJ plugin.

One of the functionalities should be a brace matcher. I already did the plugin tutorial from JetBrains. And I also got the brace matcher working with this regular expression [^@\*\{\}\(\)\$\.]* so everything is matched by the lexer except these characters. So that the brace matcher can work.

But now I've got a new problem.

Some code specific parts are splitted. So everytime when there is { or } the code gets splitted.

This is a big problem for JavaScript because the formatter destroys the code.

My question is: How do I get the brace matcher working and keep the right formatting of JavaScript?

Seki
  • 11,135
  • 7
  • 46
  • 70
CrustyCheese
  • 49
  • 1
  • 5

1 Answers1

0

Your lexer should match the entire text of the file. You should be generating tokens for each of the bracket symbols.

sylvanaar
  • 8,096
  • 37
  • 59