Adopting Language Server for Apache Camel: feedback from a Java/Eclipse plugin developer perspective Aurélien Pupier Senior Software Engineer 13th June 2018 @apupier
CONTEXT
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
State of current tools
Language Server More (unofficial) coming...
How to write the server? Write in your own language!
How to write the server? Let’s search for examples! LSP4J
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!!
How to write the server? For the future? ● Docker image? ● Tutorial https://github.com/LucasBullen/LSP4J_Tutorial
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!
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...
Technical advice - IDE integration ● “Manual” installation showstopper ● Marketplaces integration ○ Account creation hell ○ Specific terminology/build
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
Technical advice - IDE integration Eclipse Desktop (2/2) ● To help development: ○ Configure remote debug possibilities ○ Communication log
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!
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”
Architecture - multi-Language Server ● Several LS on same file? ● How to avoid redundancy? ○ Extension points in a LS? ○ Clients responsible to merge results? ○ Formatting?
Demo - State of LSP for Camel
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
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
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?
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 :-)
Start writing your Language Server! Aurélien Pupier Senior Software Engineer @apupier
Evaluate the Sessions -1 0 +1 Sign in and vote at eclipsecon.org

Adopting language server for apache camel feedback from a java/Eclipse plugin developer perspective

  • 1.
    Adopting Language Serverfor Apache Camel: feedback from a Java/Eclipse plugin developer perspective Aurélien Pupier Senior Software Engineer 13th June 2018 @apupier
  • 2.
  • 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
  • 4.
  • 5.
  • 6.
    How to writethe server? Write in your own language!
  • 7.
    How to writethe server? Let’s search for examples! LSP4J
  • 8.
    How to writethe 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 writethe server? For the future? ● Docker image? ● Tutorial https://github.com/LucasBullen/LSP4J_Tutorial
  • 10.
    Now test withIDEs! ● 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 IDEto 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-LanguageServer ● Several LS on same file? ● How to avoid redundancy? ○ Extension points in a LS? ○ Clients responsible to merge results? ○ Formatting?
  • 18.
    Demo - Stateof LSP for Camel
  • 19.
    Time/resource management ● Half-dayper 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? ● Implementall 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 yourLanguage Server! Aurélien Pupier Senior Software Engineer @apupier
  • 24.
    Evaluate the Sessions -10 +1 Sign in and vote at eclipsecon.org