eclipse-lsp4j / lsp4j

A Java implementation of the language server protocol intended to be consumed by tools and language servers implemented in Java.
https://eclipse.org/lsp4j
Other
581 stars 141 forks source link

Enforce coding standards with tooling #256

Open jonahgraham opened 5 years ago

jonahgraham commented 5 years ago

We should enforce coding standards with tooling, including a way to format the code. I assume gradle has such capabilities readily accessible.

This is to prevent future contributors to have to go through the pain @thraidh did in #254

thraidh commented 5 years ago

There is https://github.com/sherter/google-java-format-gradle-plugin, which does not seem to be configurable. The generated Java files seem to adhere at least the indentation style, though.

Alternatively you could adopt https://editorconfig.org/, which is supported by a lot of editors either natively or via plugin (including Eclipse, IntelliJ and Netbeans).

kittaakos commented 5 years ago

We can have project-specific formatting options for Eclipse and do the "same" in VS Code, and format the code on save.