CMake Language Server?

I suggest implementing the Language Server Protocol inside CMake for ease of use inside any compliant IDE.
Some notes about architecture design will be later in this topic.

What do you think about this idea?
Kind regards,


Design will need to (likely) rework a lot of CMake internals because CMake is very stateful and asking questions about this point of the configure needs to (generally) be asked when CMake is at that point in processing the file. The statefulness means processing from the beginning again (and potentially rerunning any execute_process and other not-so-cheap commands).

Note that there are debugging proposals (not sure if they leverage LSP or not):


Totally in favor of it. We should leverage existing codebse and provide support for LSP servers. Would be nice. If anyone interested on working on a PR, let me know!

There are a couple of implementations already btw, so we can use them as reference, e.g.:

I think they are inefficient.

1 Like