erlang-ls / erlang_ls

The Erlang Language Server
https://erlang-ls.github.io/
Apache License 2.0
628 stars 136 forks source link

Add CLI flags to dump info instead of running as a language server #685

Open alanz opened 4 years ago

alanz commented 4 years ago

It can be useful to be able to check that a project is set up correctly for use in erlang_ls, as well as to query what capabilities the language server has, without actually running it in an IDE.

This helps with debugging, because you can decouple IDE setup from project setup.

Useful information to provide when invoking a flag would be

Also, if a specific file or set of files is passed on the command line, these could be loaded and processed, with reporting on any issues found, such as missing dependencies etc.

A similar feature is implemented in ghcide, see https://github.com/digital-asset/ghcide#test-ghcide

robertoaloi commented 4 years ago

I like the idea. We could make it a separate erlang_ls_debug script, à la riak:

https://github.com/basho/riak/blob/develop-3.0/rel/files/riak-debug

The script (I would actually make it an escript itself) would basically just use the Erlang RPC API to retrieve those info from the server node.

alanz commented 4 years ago

The feature is the important thing, how precisely it is invoked less so.

alanz commented 4 years ago

The script (I would actually make it an escript itself) would basically just use the Erlang RPC API to retrieve those info from the server node.

Except this approach assumes you have a running node. I would like to be able to run this on a bare project, without an IDE active. In which case it should start whatever nodes the normal one would have, and report what it found.

If it was already running, then tapping in would make sense.

robertoaloi commented 4 years ago

That would make sense.