How to submit a standout Adobe Champion Application
Easily-extendable Eclipse Text Editor for quick language support and more
1. The New Generic and
Extensible Code Editor
Easily-extendable Eclipse Text Editor for quick
language support and more
Sopot Cela Mickael Istria
2. Why ‘Generic’ ?
- One Editor & Multiple per-language extensions versus One Editor per language approach
- Instead of creating an editor, ‘smarten up’ the generic editor to sense and support a language
3. Features
- Extensible autocomplete
- Extensible hover (tooltip) information
- Extensible syntax highlighting
- Similar concept to the way Notepad++ works
4. The editor is an empty shell, it will do as much as content you provide it through
extensions
“Extensible”, you said?
5. Content-type centric
- You want to add features for a given language, not much for an editor.
- Extensions register themselves against content-types, the editor picks
the active one according to the content-type of current document.
- You can either create a custom content-type or use a pre-defined one
6. And how exactly does it work in practice?
1. Get a new or existing plug-in project
2. Add an extension to e.g. org.eclipse.ui.genericeditor.presentationReconcilers
a. Supply a content-type for which this code will work
3. Write the presentation (or autocomplete or hover) logic code
9. Underlying Vision
1. Productivity & Time to market: Make possible quick language support with
very little boilerplate
2. Separation of concerns: Abstract out the provider of the ‘smartness’ for a
given language
a. Opens the road to using language servers
3. Quality, maintenance & DRY: do we need as many text editors as
languages
a. More consistency
b. More factorization (less maintenance cost)
c. Less memory consumption
10. Language Server Protocol (LSP)
LSP defines a unified way to get edition assist (completion, hover,
rename…) from whatever “blackbox”.
11. LSP in Eclipse
Many LSP operations already doable with Eclipse commands and
handlers: hook LSP-based handler on commands when supported.
Hooking hover and completion now doable with Eclipse Generic
Editor
12. LSP in Eclipse (cont’d)
Eclipse IDE user
/ide
Generic
and
extensible
editor
LSP
Integration
Hover
Completion
OmniSharp
Launch Config
VSCode-CSS
Launch Config
VSCode-JSON
Launch Config
Whatever
Launch Config
Local
Local
?
Protocol over * streams
LSP4J
workspace
13. User to manually associate a language server and a content-type. No code, no
plugin! Requires user to manually define content types
http://bugs.eclipse.org/500892
Move this to Eclipse.org!
Next steps for Eclipse and LSP
14. Demo schedule
1. Sample .gradle syntax highlighting support
2. Language server demo: C# editor
17. Use it now!
1. Try it out!
a. We have a plug-in template wizard for that
b. Try it for your use-case and give feedback
2. Contribute basic support for a language
a. It doesn’t have to be a well-defined language
b. E.g. we have a sample for .project file editor
18. Future Plans
1. Get Generic Editor infrastructure improved
a. improve extensibility areas
b. continuous bug fixes as adoption grows
2. Language Server push
a. project proposal (LSP4E, ecLSP…) in progress. Come to be registered as Interested Parties