Adopting language server for apache camel feedback from a java/eclipse plugin developer perspective
https://github.com/camel-tooling/camel-language-server
Adopting Language Server for Apache Camel: feedback from a Java plugin developer
1. Adopting Language Server for Apache Camel:
feedback from a Java/Eclipse plugin developer
perspective
Aurélien Pupier
Senior Software Engineer
13th
June 2018
@apupier
3. CONTEXT
● Apache Camel
○ Well established Open Source project
○ Project integration
● 2 existing tools
○ Graphical
○ Textual
● Users stay on their preferred IDE
○ Better for the project under integration
○ Hipsters
○ Just don’t want to learn a new IDE
● Java/Eclipse plugin developer
6. How to write the server?
Write in your own language!
7. How to write the server?
Let’s search for examples!
LSP4J
8. How to write the server?
● LSP4J
● Fat jar for easy launch
● Restrict to a single-file scope (if possible)
● TextDocumentSyncKind.Full
● sysin/sysout
○ ⇒ No log on sysout!!
9. How to write the server?
For the future?
● Docker image?
● Tutorial
https://github.com/LucasBullen/LSP4J_Tutorial
10. Now test with IDEs!
● Configuration more or less easy
● Too complex for real users!!
⇒ Need to provide a client per IDE starting the server!
⇒ in different languages!
11. With which IDE to start?
● Eclipse Desktop IDE
○ we know it!
● VS Code
○ De facto “reference implementation”
○ Trendy
● Eclipse Che/OpenShift.io
○ Web-based
○ Java
● Listen to your existing community
More (unofficial)
coming...
12. Technical advice - IDE integration
● “Manual” installation showstopper
● Marketplaces integration
○ Account creation hell
○ Specific terminology/build
13. Technical advice - IDE integration
Eclipse Desktop (1/2)
● LSP4E
● (Process)StreamConnectionProvider
● Content-type association
● Generic text editor only!
○ No XML LS (with completion)
○ Reuse XML Editor
14. Technical advice - IDE integration
Eclipse Desktop (2/2)
● To help development:
○ Configure remote debug possibilities
○ Communication log
15. Technical advice - IDE integration
VS Code
● How to launch Java from TypeScript?
○ Java LSP client example, now also Camel Client
● Don’t know yet for writing a test…
● Not friendly with bad request
○ log on stdout → crash!
16. Technical advice - IDE integration
Eclipse Che - OpenShift.io
● Easy to write
● Che developers kind enough to validate
● Web-based!
● Requires recompilation
● Hard to test
● Not activated by default
○ Requires changing preference
○ Or to provide a specific “Che stack”
17. Architecture - multi-Language Server
● Several LS on same file?
● How to avoid redundancy?
○ Extension points in a LS?
○ Clients responsible to merge results?
○ Formatting?
19. Time/resource management
● Half-day per week for 2 developers during 7
months
○ Regularly skipped…
○ But also several hours reading docs
● Communities working on LSP are active
20. In a nutshell
● LSP known only in Eclipse/Tooling world
● Key points:
○ List of potential supported IDEs
○ Demo in one desktop and one web-based IDE
○ Marketplace entries
● Few work weeks to have several IDEs supported
● Plan a bit of time to bootstrap for all wanted IDEs
21. What’s next?
● Implement all of LSP
● Cross-LS…
● Other protocols?
○ Debug Adapter Protocol
○ Creating new project?
○ Graphical server protocol?
● IDE client?
○ Docker
○ LS Marketplace?
22. Want more LSP @EclipseCon?
● Wed 10:45 Implementing Language Servers - the
Good, the Bad, the Ugly by Martin Lippert
● Wed 10:45 The future of development tooling: the
example of Eclipse Che, Theia and Sirius by Mélanie
Bats and Stevan Le Meur
● Wed 16:30 IoT Cloud development with Che by Jens
Reimann
● Thur 10:45 sprotty - Graphical Views For Web
Applications
● Come chat with me :-)
23. Start writing your Language Server!
Aurélien Pupier
Senior Software Engineer
@apupier