line / armeria

Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.
https://armeria.dev
Apache License 2.0
4.83k stars 918 forks source link

Migrate IntelliJ Idea settings #1907

Open ikhoon opened 5 years ago

ikhoon commented 5 years ago

Exporting settings.jar is no longer supported in IntelliJ Idea. We have to migrate it into settings.zip. Additionally sharing settings through a settings repository looks good for initial setup and continuous updating.

anuraaga commented 5 years ago

I always enable Settings Sync, so I'm not sure I'd be able to use a settings repository.

An alternative to look at would be adding build scripts that use the IdeaPlugin so the ./gradlew idea task sets it up automatically. I've had good experience with this.

This might be an example (in Java, but the XML logic would actually be a lot simpler if migrated to a Groovy build script)

https://github.com/curioswitch/curiostack/blob/master/tools/gradle-plugins/gradle-curiostack-plugin/src/main/java/org/curioswitch/gradle/plugins/curiostack/CuriostackPlugin.java#L277

It's a bit tricky ensuring the right merge semantics, but once it's done once it works well I think.

ikhoon commented 5 years ago

Unfortunately, Settings Sync can't come with Settings Repository, which is a current limitation. But you can add multiple read-only setting repositories. If a user wants to get & apply Armeria IntelliJ settings, he or she adds the settings Github URL as a read-only source. image

And IdeaPlugin also looks so good. I agree sharing IntelliJ setting with XML(ie. intellij-java-google-style.xml) is more explicit, clear, and easy to maintain than settings.jar. Thanks for sharing it!

heowc commented 2 years ago

I recently found out that the code style of an intellij idea can be extracted to .editorconfig

Screen Shot 2022-01-21 at 16 30 52 PM

But this has some problems, but I think it might be useful.

See https://youtrack.jetbrains.com/issue/IDEA-223437

trustin commented 2 years ago

It seems like customizing IdeaPlugin in Gradle is the way to go at the moment, because a user doesn't have to import anything manually.

anuraaga commented 2 years ago

@trustin If I'm not mistaken, InteliJ's default is to respect editorconfig without any manual import. In the years since writing IdeaPlugin integration, IDEA's made some good progress on it and editorconfig might actually be enough, except for copyright header unfortunately. My current code pattern is to not bother configuring IDEA with a copyright header and using spotless to automatically add it, and apply any (google java) formatting that may have been missed by editorconfig before committing.

heowc commented 2 years ago

Incidentally, the intellij idea is correct, but Eclipse requires a separate plugin to be installed. I'm used to the Armeria setup, so I'm using it for my personal projects. :sunglasses:

See https://github.com/heowc/SpringBootSample/blob/main/.editorconfig