WhatsApp / erlang-language-platform

Erlang Language Platform. LSP server and CLI.
https://whatsapp.github.io/erlang-language-platform/
Apache License 2.0
235 stars 19 forks source link

Undocumented required fields in [buck] for TOML file #42

Open jamesaimonetti opened 1 month ago

jamesaimonetti commented 1 month ago

Following https://whatsapp.github.io/erlang-language-platform/docs/get-started/configure-project/elp-toml/

> elp version
elp 1.1.0+build-2024-08-05

Docs say having enabled = false under [buck] looks like enough.

First time loading an Erlang source file in Emacs I see:

LSP :: unable to read /home/me/erlang_project/elp.toml: missing field `build_deps` for key `buck` at line 4 column 1

OK so I set buck to:

[buck]
enabled = false
build_deps = false

Next Erlang file opened sees:

LSP :: unable to read /home/me/erlang_project/.elp.toml: missing field `included_targets` for key `buck` at line 4 column 1

Tedious to have to discover these one by one, no? Is there a schema or definition for the TOML file to consult?

jamesaimonetti commented 1 month ago

Sorry, late night and I put this issue here instead of under the elp repo - can someone transfer it or should I recreate there?

michalmuskala commented 1 month ago

Moved issue to the ELP repo

robertoaloi commented 1 month ago

There's no schema at the moment. It would be great to have one and, ideally, generate the docs out of it. Contributions are always welcome :)

For the specific parameter, it's probably unintended. We may just have it as an optional value and default to false.

alanz commented 1 month ago

Until we document it properly, note that the entire [buck] section is optional, see

https://github.com/WhatsApp/erlang-language-platform/blob/baad62631f170e27a650dd03bbfbc2bf56ef6b01/crates/project_model/src/lib.rs#L1643-L1646

A more full example is

https://github.com/WhatsApp/erlang-language-platform/blob/baad62631f170e27a650dd03bbfbc2bf56ef6b01/crates/project_model/src/lib.rs#L1712-L1728

jamesaimonetti commented 1 month ago

Sounds good, thanks. Just dipping the toe in to see how ELP compares with Erlang LS for our KAZOO project. If ELP displaces Erlang LS, I'm sure there'll be some contributions coming as I go!

Thanks for the work thus far.

alanz commented 1 month ago

I am re-opening this as we still need to update the docs