1

Eclipse has a feature where it automatically inserts things. (eg. closing curly braces after pressing ENTER on an opening curly brace)

This is found in Preferences > Java > Typing.

I would like to add a similar feature in a Plugin of mine that automatically closes DO-Blocks with an END statement and moves the cursor to inside the DO-Block.

I have already looked through the documentation of Eclipse but I can not seem to find a way to trigger an action on ENTER and with a context.

Is there a simple way to do this?

Alex Linz
  • 11
  • 2
  • The Java editor just uses the many features provided by the Eclipse text editor framework. – greg-449 Jan 18 '21 at 09:08
  • Auto-closing of brackets can also be implemented via a language server configurations (which does not require a language server to be used), see e.g. [here](https://github.com/eclipse/wildwebdeveloper/blob/master/org.eclipse.wildwebdeveloper/language-configurations/javascript/javascript-language-configuration.json#L27-L35). – howlger Jan 18 '21 at 09:44

0 Answers0