Language Server Protocol enables language features to be built for editors in a common and reusable manner. Eclipse MicroProfile seeks to optimize enterprise Java for microservices architecture. The newly created incubator project, Eclipse LSP4MP, attempts to build a language server for MicroProfile APIs to enable developers to easily build cloud-native applications using Eclipse MicroProfile.
In this session, we will provide an introduction to the project, share the latest progress, and discuss what's next. We will share about the journey to build this first language server for Eclipse MicroProfile and lessons accrued along the way. We invite you to join us, share your feedback, and work together to build out Eclipse LSP4MP!
This was a talk delivered at EclipseCon 2020.
2. Who we are
2
Ryan Zegray
@RyanZegray
Kathryn Kodama
@KathrynKodama
YK Chang
@yeekangc
3. What is Eclipse MicroProfile?
● Eclipse MicroProfile is an open-source community specification for Enterprise Java
microservices
● A community of individuals, organizations, and vendors collaborating within an open
source (Eclipse) project to bring microservices to the Enterprise Java community
3
https://openliberty.io/docs/intro/microprofile.html
4. What is a Language Server?
● Language Server
○ Provides language specific features, such as code complete, hover, go
to definition, quick fixes and diagnostics.
○ Communicates with a code editor via the Language Server Protocol.
● Language Server Protocol (LSP)
○ Open source protocol specification to standardize the communication
between code editors and language servers.
4
5. Why a Language Server?
Language Server benefits
● Before LSP, each editor would have its own API for adding language features
● With LSP, one server implementation can work with multiple editors
● Language server can be written in any language
5
6. Eclipse LSP4MP
● Language Server implementation based on the Language Server Protocol for the Eclipse
MicroProfile programming model
● Provides core language support capabilities (such as code complete, diagnostics, quick
fixes) to enable developers to easily and quickly develop cloud-native applications using
MicroProfile APIs
6
7. Project Community
7
@fbricon @angelozerr @datho7561
@RyanZegray @KathrynKodama @ericglau @yeekangc
Jeff Maury
Baibhab Debnath
Emily Jiang
Ivar Grimstad
David Kwon
8. Architecture
Two components:
● MicroProfile LS that provides MicroProfile language features using LSP
● MicroProfile JDT.LS Extension which extends the Eclipse JDT.LS (Java language
server) to provide Java project information to the MicroProfile LS (i.e. Java classpath
changes, AST info etc.)
8
• Communicate to each
through the IDE using JSON-
RPC
9. Java Language Support
● Java already has excellent language support
○ Eclipse Java Development Tools (JDT) and the JDT.LS Language Server
that uses the JDT
● Problem: When providing MicroProfile support we do not want to duplicate the
work already being done by the JDT (computing the classpath, building
Abstract Syntax Tree, etc.)
○ Solution: Reuse what we can get from JDT through MicroProfile JDT.LS
extension
9
14. IDE Clients
● An IDE or editor client surfaces the language support capabilities provided by
a language server to the users of an IDE or editor
● Tools for MicroProfile
○ A Visual Studio Code extension that provides support for the development of
MicroProfile-based applications via Eclipse LSP4MP
○ https://github.com/redhat-developer/vscode-microprofile
14
15. Extending Eclipse LSP4MP
● Eclipse LSP4MP handles language features for both properties files and Java
files.
○ Properties files – completion, diagnostics (validation), documentation
○ Java files – snippets, diagnostics, code actions/quick fixes.
● Third parties can extend LSP4MP to provide additional functionality through
Java SPI.
○ Ex. Quarkus provides additional snippets as well as support for Quarkus
specific config properties.
15
17. Lessons Learnt
● Reuse what is available through JDT.LS via extension point
● Flexibility and opportunities for community to participate and innovate
○ 1 common language server that can be exposed by different clients for
different editors or IDEs
○ LSP4MP can extended by others to provide additional capabilities
17
18. Where we are
● 1st release of Eclipse LSP4MP
○ 0.1 release in late September 2020
● 1st release of Tools for MicroProfile
○ 0.1 release that that uses LSP4MP 0.1
● Supported API? See next chart.
18
19. MicroProfile API Support
19
MicroProfile APIs Properties
completion
Properties
diagnostics
Java
diagnostics
Java code actions Java code snippets
Configuration x x
Context Propagation x x
Fault Tolerance x x x x x
Health x x x x x
Long Running Actions x x
Metrics x x x x x
OpenAPI x x x x
Rest Client x x x x x
JAX-RS x x x
Reactive Messaging x x
GraphQL x x
JWT Authentication x x
20. What’s Next
● Complete support for all MicroProfile APIs
● Currency and support for next major MicroProfile release
● Community collaboration on additional clients like LSP4MP clients for Eclipse
IDE and IntelliJ IDEA
20
21. ● Install Tools for
MicroProfile from the VS Code
Marketplace
● Contribute to the Eclipse
LSP4MP project on GitHub
https://github.com/eclipse/lsp4
mp
21
Get Involved