Mimicking IntelliJ's sorting of imports #488
Replies: 1 comment
-
Hi @simon1573. We had a similar problem at my workplace with Visual Studio Code & IntelliJ users. You can change the import order using the For config.settings = {
java = {
completion = {
importOrder = {
"java",
"javax",
"org",
"com"
}
}
}
} See @mfussenegger's sample configuration for more context: See https://github.com/redhat-developer/vscode-java#supported-vs-code-settings for more details on this configuration option, and others that are available. There's also static imports to consider. I believe JDTLS will layout static imports separately with no way to change this behavior, but this is an option in IntelliJ. See Intellij Import Layout options:
I believe IntelliJ has a similar ability to specify the import order somewhere. I would reach out to your IntelliJ co-workers to determine what IntelliJ's default import order is, or have everyone define the same order. |
Beta Was this translation helpful? Give feedback.
-
Example of a file IntelliJ has organized imports of
Example of a file jdtls has organized imports of
I'm working in a team of IntelliJ users and IntelliJ has a different import sorting order than jdtls, resulting in unnecessary code changes every time I run "Organize imports".
Is there a way to configure nvim-jdtls to organize the imports in the same order as IntelliJ?
Beta Was this translation helpful? Give feedback.
All reactions