Feedback from an Eclipse plugin developer to provide support to a large set of IDE based on Language Server Protocol Aurélien Pupier Principal Software Engineer 19th November 2019 @apupier Eclipse Tools Day Grenoble 2019
I’m an Eclipse Plugin developer. I want to reach a larger audience for my Language. Context 2
3 Which complexity? IDE skills Language skills Eclipse Desktop IDE VS Code Emacs ... N implementations with high skill required in language and IDE extension
Write Code Editing capabilities once, run in all IDEs! The Promise of Language Server Protocol 4
Write Code Editing capabilities once, run in all IDEs! (after a setup for each IDE and for most features) The (real) Promise of Language Server Protocol 5
- Autocomplete - Hover - Code Lens - Goto Definition/References - Formatting / Coloring - Renaming - Code actions - Highlighting - Folding - Diagnostic Code editing capabilities 6
7 Language Server More coming... N implementations with low skill for IDE + 1 implementations with high skill required in language only
8 Language Server
How to write the server? 9 LSP4J
How to write the server? 10 ● LSP4J ● Fat jar for easy launch ● Restrict to a single-file scope (if possible) ● TextDocumentSyncKind.Full ● sysin/sysout ○ ⇒ No log on sysout!!
Server Implementation examples 11 ● Very simple ○ https://github.com/apupier/language-server-template-java ● Good examples ○ https://github.com/camel-tooling/camel-language-server ○ https://github.com/angelozerr/lsp4xml ● A full blown headless Eclipse desktop ○ https://github.com/eclipse/eclipse.jdt.ls ● Search in Official site listing ○ https://microsoft.github.io/language-server-protocol/implementors/servers/
I have a first server iteration: Now test with IDEs! 12 ● Configuration more or less easy ● Too complex for real users!! ⇒ Need to provide a client per IDE starting the server! ⇒ in different languages! ⇒ in different communities!
With which IDE to start? 13 ● Eclipse Desktop IDE ○ we know it! ● VS Code ○ De facto “reference implementation” ○ Trendy ○ Can be reused in Eclipse Che ● Listen to your existing community
Technical advice - IDE integration Eclipse Desktop (1/2) 14 ● LSP4E ● (Process)StreamConnectionProvider ● Content-type association ● Generic text editor only!
Technical advice - IDE integration Eclipse Desktop (2/2) 15 ● To help development: ○ Configure remote debug possibilities ○ Communication log
Technical advice - IDE integration VS Code (1/2) 16 ● How to launch Java from TypeScript? ○ Java LSP client example, now also Camel Client ● Writing a test is not trivial ● Not friendly with bad request ○ log on stdout → crash!
Technical advice - IDE integration VS Code (2/2) 17 ● To help development: ○ Logging ○ LSP inspector
Technical advice - IDE integration Eclipse Che 7 18 ● Reuse VS Code extension ● Web-based demo!
Technical advice - IDE integration CodeMirror 19 ● Embeddable web editor ● /! WebSocket ● Limited functionalities
In a nutshell 20 ● 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
Start writing your Language Server! Aurélien Pupier Principal Software Engineer @apupier Eclipse Tools Day Grenoble 2019
22
Technical advice - IDE integration Atom 23 ● Easy to publish to Marketplace ● Small codebase ● Hard to debug/setup dev env
Technical advice - IDE integration Vim 24 ● Lightweight ● Only readme provided ● Ecosystem is too complicated for newcomers
Time/resource management 25 ● Half-day per week for 2 developers during 7 months ○ Regularly skipped… ○ But also several hours reading docs ● 1-2 days per week for 2 developers during 2 months ● Communities working on LSP are active
Architecture - multi-Language Server 26 ● Several LS on same file? ● How to avoid redundancy? ○ Extension points in a LS? ○ Clients responsible to merge results? ○ Formatting?
What’s next? 27 ● Cross-LS… ● Other protocols? ○ Debug Adapter Protocol ○ Graphical server protocol? ○ Creating new project? ● IDE client? ○ Docker ○ LS Marketplace? ○ Clients generator?

Feedback from an eclipse plugin developer to provide support to large set of ide based on language server protocol

  • 1.
    Feedback from anEclipse plugin developer to provide support to a large set of IDE based on Language Server Protocol Aurélien Pupier Principal Software Engineer 19th November 2019 @apupier Eclipse Tools Day Grenoble 2019
  • 2.
    I’m an EclipsePlugin developer. I want to reach a larger audience for my Language. Context 2
  • 3.
    3 Which complexity? IDE skillsLanguage skills Eclipse Desktop IDE VS Code Emacs ... N implementations with high skill required in language and IDE extension
  • 4.
    Write Code Editingcapabilities once, run in all IDEs! The Promise of Language Server Protocol 4
  • 5.
    Write Code Editingcapabilities once, run in all IDEs! (after a setup for each IDE and for most features) The (real) Promise of Language Server Protocol 5
  • 6.
    - Autocomplete - Hover -Code Lens - Goto Definition/References - Formatting / Coloring - Renaming - Code actions - Highlighting - Folding - Diagnostic Code editing capabilities 6
  • 7.
    7 Language Server More coming... Nimplementations with low skill for IDE + 1 implementations with high skill required in language only
  • 8.
  • 9.
    How to writethe server? 9 LSP4J
  • 10.
    How to writethe server? 10 ● LSP4J ● Fat jar for easy launch ● Restrict to a single-file scope (if possible) ● TextDocumentSyncKind.Full ● sysin/sysout ○ ⇒ No log on sysout!!
  • 11.
    Server Implementation examples 11 ●Very simple ○ https://github.com/apupier/language-server-template-java ● Good examples ○ https://github.com/camel-tooling/camel-language-server ○ https://github.com/angelozerr/lsp4xml ● A full blown headless Eclipse desktop ○ https://github.com/eclipse/eclipse.jdt.ls ● Search in Official site listing ○ https://microsoft.github.io/language-server-protocol/implementors/servers/
  • 12.
    I have afirst server iteration: Now test with IDEs! 12 ● Configuration more or less easy ● Too complex for real users!! ⇒ Need to provide a client per IDE starting the server! ⇒ in different languages! ⇒ in different communities!
  • 13.
    With which IDEto start? 13 ● Eclipse Desktop IDE ○ we know it! ● VS Code ○ De facto “reference implementation” ○ Trendy ○ Can be reused in Eclipse Che ● Listen to your existing community
  • 14.
    Technical advice -IDE integration Eclipse Desktop (1/2) 14 ● LSP4E ● (Process)StreamConnectionProvider ● Content-type association ● Generic text editor only!
  • 15.
    Technical advice -IDE integration Eclipse Desktop (2/2) 15 ● To help development: ○ Configure remote debug possibilities ○ Communication log
  • 16.
    Technical advice -IDE integration VS Code (1/2) 16 ● How to launch Java from TypeScript? ○ Java LSP client example, now also Camel Client ● Writing a test is not trivial ● Not friendly with bad request ○ log on stdout → crash!
  • 17.
    Technical advice -IDE integration VS Code (2/2) 17 ● To help development: ○ Logging ○ LSP inspector
  • 18.
    Technical advice -IDE integration Eclipse Che 7 18 ● Reuse VS Code extension ● Web-based demo!
  • 19.
    Technical advice -IDE integration CodeMirror 19 ● Embeddable web editor ● /! WebSocket ● Limited functionalities
  • 20.
    In a nutshell 20 ●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.
    Start writing yourLanguage Server! Aurélien Pupier Principal Software Engineer @apupier Eclipse Tools Day Grenoble 2019
  • 22.
  • 23.
    Technical advice -IDE integration Atom 23 ● Easy to publish to Marketplace ● Small codebase ● Hard to debug/setup dev env
  • 24.
    Technical advice -IDE integration Vim 24 ● Lightweight ● Only readme provided ● Ecosystem is too complicated for newcomers
  • 25.
    Time/resource management 25 ● Half-dayper week for 2 developers during 7 months ○ Regularly skipped… ○ But also several hours reading docs ● 1-2 days per week for 2 developers during 2 months ● Communities working on LSP are active
  • 26.
    Architecture - multi-LanguageServer 26 ● Several LS on same file? ● How to avoid redundancy? ○ Extension points in a LS? ○ Clients responsible to merge results? ○ Formatting?
  • 27.
    What’s next? 27 ● Cross-LS… ●Other protocols? ○ Debug Adapter Protocol ○ Graphical server protocol? ○ Creating new project? ● IDE client? ○ Docker ○ LS Marketplace? ○ Clients generator?