A language server for CMake.
From the first time I heard about language servers I was very excited by the idea. At the same time I had to work a lot with CMake and was quite disappointed by the existing editing support in IDEs (typically syntax highlighting, auto-completion for keywords and built-in functions, but no features requiring semantics). So I decided to play with a language server for CMake. My idea was to implement the language server in C++ to be able to easily access CMake information by interfacing with CMake's implementation.
Since I couldn't find an existing LSP implementation in C++ which was easy to re-use and I found it very interesting to implement a language server from scratch, I started this project as 2 components: lscpp, LSP implementation in C++ (similar to lsp4j for Java) and cmakels building on top of it.
At this point, cmakels is still in a prototype phase. It provides only minimal features and is very unstable. However, having cmakels enabled in your IDE will usually not harm your developing experience as either cmakels will just not give language support or will even crash (and therefore stop providing language support). I have it enabled for all my development work...
- Go to definition for
add_subdirectory()
will jump to the first line in theCMakeLists.txt
of the referenced folder. - Hovering a variable will show the value of the variable (has some known issues, e.g. related to issue #32).
Currently there is only an extension for VSCode.
Contributions are welcome. Please follow the style of existing code and apply clang-format.
cmakels is published under the BSD-3-clause license (SPDX short identifier: BSD-3-Clause
)