rhaiscript / lsp

Language server for Rhai.
Apache License 2.0
43 stars 4 forks source link

Formattin and config in CLI #99

Closed tamasfe closed 1 year ago

tamasfe commented 1 year ago

Added the following to the CLI:

It is now possible to mass-format files via the cli.

Custom operators are supported based on the definition files that can be found according to the Rhai.toml or default config, this means that at the beginning we build up a HIR. It might sound overkill just for formatting, but this way the user does not have to do anything extra to support custom operators.

schungx commented 1 year ago

So I do a rhai fmt in a directory?

tamasfe commented 1 year ago

Yes, if you do just rhai fmt, files included in the config (or current dir if no rhai config exists) will be formatted, alternatively you can do rhai fmt . or rhai fmt "some/glob/**/*.rhai"