Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] Enhanced extensibility for the default text editor in Eclipse

Platform UI developers,

Me and Mickael Istria have been working on making it easier to extend the default text editor in Eclipse.

The target here is to minimize the amount of work that is needed to provide support for a new language in the Eclipse IDE, at least for the basic things like syntax coloring, hover, quick assist and autocomplete. You can think of it as turning the default text editor from a notepad to a notepad++ which senses and provides basic support for multiple languages.

There are a lot of ways to go with this but we decide to provide extension points to the default text editor. Technically speaking, the TextSourceViewerConfiguration would not be a 'dumb' editor configuration anymore and by default provide nothing except spell checking but it will expect extensions to become smarter. This is where the 'smartness' would be supposed to be plugged in. This is already somewhat similar to what is supported with hyperlink behavior but the plan is to extend it to many more functionalities. So it would go from providing default behavior (very minimalistic) to reading for extensions to get smarter behavior. If there are no extensions present this would mean zero difference from what it is now.

Of course you could still extend the default editor just like you have done for years. This is an alternative way to provide support for other languages by making the default editor smarter, rather than creating your own editor. We think this would not be interfering with the present way of doing things. Rather we'd be adding 'smartness' extension points which you might or might not want to use. In this way we're hoping to lower the barrier of developing, at least initial, support for new languages.

We have a proof of concept for this in gerrit: https://git.eclipse.org/r/75921 . Right now we have hover, autocomplete and syntax coloring extensibility support. Reconciling and quick assist extensibility are coming soon. We have some trivial examples and tests also to show the extensibility in action, but the extensibility mechanism itself is the true value of the gerrit. We tried to run Eclipse IDE with our patch containing the extensions and extension points and we didn't yet see any interference with the existing editors. This is because they override default behavior so do not inherit anything and making it backward compatible.

Please give it a try and leave some constructive feedback. We'd be more than happy to consider and drive this in the right direction.

There is a relation between this work and a previous discussion on language services. These extension points we would provide would be responsible for feeding language support: contents of auto complete, how to color the syntax etc. This 'smartness' can come from a lot of sources which are irrelevant to our editor work, but one source could be a language server.

Let us know your thoughts,

Sopot


Back to the top