A Language Server is meant to provide the language-specific smarts and
communicate with development tools over a protocol that enables
inter-process communication. The Language Server
Protocol (LSP)
defines the protocol used between an editor or IDE and a language server
that provides language features like auto complete, go to definition,
find all references etc.
Adding features like auto complete, go to definition, or documentation
on hover for a programming language takes significant effort.
Traditionally this work had to be repeated for each development tool, as
each tool provides different APIs for implementing the same feature (see
the list of Editors and IDEs).
Additionally as the existing tools use `libdparse` (used in
DLS and
DCD), they lack the ability to
perform semantic analysis on the AST and can\'t evaluate `mixin`\'s
nor D\'s very powerful Compile-Time Function Evaluation (CTFE).
The idea behind the Language Server Protocol (LSP) is to standardize the
protocol for how such servers and development tools communicate. This
way, a single D Language Server can be re-used in multiple development
tools, which in turn can support multiple languages with minimal effort.
Recent development in the DMD compiler made it available as a DUB
library.
This mean that the compiler itself can be re-used and third-party tools
don\'t have to re-implement e.g. D\'s complex CTFE. This project is
about using the DMD compiler as a library to implement a Language Server
for D.
A Language Server is meant to provide the language-specific smarts and communicate with development tools over a protocol that enables inter-process communication. The Language Server Protocol (LSP) defines the protocol used between an editor or IDE and a language server that provides language features like auto complete, go to definition, find all references etc.
Adding features like auto complete, go to definition, or documentation on hover for a programming language takes significant effort. Traditionally this work had to be repeated for each development tool, as each tool provides different APIs for implementing the same feature (see the list of Editors and IDEs). Additionally as the existing tools use `libdparse` (used in DLS and DCD), they lack the ability to perform semantic analysis on the AST and can\'t evaluate `mixin`\'s nor D\'s very powerful Compile-Time Function Evaluation (CTFE).
The idea behind the Language Server Protocol (LSP) is to standardize the protocol for how such servers and development tools communicate. This way, a single D Language Server can be re-used in multiple development tools, which in turn can support multiple languages with minimal effort.
Recent development in the DMD compiler made it available as a DUB library. This mean that the compiler itself can be re-used and third-party tools don\'t have to re-implement e.g. D\'s complex CTFE. This project is about using the DMD compiler as a library to implement a Language Server for D.
Proposed Project Mentors: @jacob-carlborg @wilzbach