Code formatter for Vala

I have only recently started programming with Vala. So far I have been using LSP’s format buffer function to format code to ensure it conforms to Vala’s idiomatic style. I have noticed that vala-language-server seems to run the uncrustify tool, however it doesn’t do very well when the code uses lambda expressions; in some cases uncrustify actually removes code because it doesn’t seem to know how to parse lambda expressions.

I looked at clang-format but, again, it doesn’t seem to do well when lambda expressions are involved. I was wondering if there exists a specific tool for formatting Vala code that works well?

I would suggest filing a bug here: Issues · vala-lang/vala-language-server · GitHub

This shouldn’t happen. There is another code formatter, but it works only for the Elementary code style:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.