mfussenegger / nvim-jdtls

Extensions for the built-in LSP support in Neovim for eclipse.jdt.ls
GNU General Public License v3.0
1.09k stars 62 forks source link

Use google-java-format #442

Closed sfc-gh-mamsterdam closed 1 year ago

sfc-gh-mamsterdam commented 1 year ago

Problem Statement

Hi, I understand that you can use java-google-style.xml with nvim-jdtls, but I want to be able to use the google-java-format instead. Google-java-format is more powerful/flexible and formats differently than java-google-style.

I believe this integration, if it's not already implemented, is relatively straightforward, and I believe ALE and coc support it.

Thanks!

Ideas or possible solutions

Implement it or maybe it already exists!

sfc-gh-mamsterdam commented 1 year ago

Link explaining the differences here: https://github.com/google/google-java-format/issues/695

mfussenegger commented 1 year ago

It's not supported by eclipse.jdt.ls (see https://github.com/redhat-developer/vscode-java/issues/663 & https://github.com/redhat-developer/vscode-java/issues/419) but given that it's an executable you should be able to use it with formatprg, see :help formatprg.