and would hope that some of you would share your favorite IDE settings or tips that make OpenMRS development a summer vacation This will greatly help new developers set up their IDEs.
Till today, I still canāt figure out how to set-up IntelliJ IDEA properly
I prefer using a light weight IDE like Visual Studio Code. It is not as advanced
as Eclipse or IntelliJ, but it has a handful of helpful extensions!
thanks for sharing! Thats good to know, I also often feel overwhelmed with all the settings/plugins in Eclipse & IntelliJ. Thats why I thought we should have better docs so new devs or older ones (me included) dont have to go through the same pain
There are pages for Eclipse, IntelliJ, Netbeans under https://wiki.openmrs.org/display/docs/Developer+How-To+Guide
Do you want to create a Visual Studio one? That would be fantastic! Iām sure others would also like to use Visual Studio but might not know how to tweak it for OpenMRS development.
@teleivo Iāll try to see if I can create one for Visual Studio Code any of these days. Oh, like I said,
itās not as advanced as Eclipse or IntelliJ, but is still awesome!
Great initiative @teleivo ! Here are a few tips for Intellij IDEA that I use and might be useful for beginners. .
Renaming all instances of a variable: Place your cursor at the end of the work and press Shift + F6. This should highlight all instances of the particular variables in that Class file and helps for quick renaming.
All project String Search: Ctrl+Shift+F. This helps you to search for a particular word/method across your entire project.
Setting up the Maven Plugins within Intellij (Can be used for Hotswapping /Refreshing Class changes without deployment): Right click on Maven projects on the left toolbar, expand the project, and you should see the entire configurations of Maven plugins. You can find jetty there, deploy, clean basically everything.
I guess thatās all that comes to mind for now. Will add to this if anything comes to mind!
Good going @teleivo .This is one post thatās going to help new devs a lot .One of the commands in Intellij which I find most useful is using Ctrl+Shift+Alt+L to reformat the code in a particular file which we want. We could also use Ctrl+Alt+L but it probably re-formats the whole code(Not recommended). More information on the same can be found here : https://www.jetbrains.com/help/idea/2016.3/reformatting-source-code.html
love the way you are making things easier for new-devs @teleivo . This is a pretty simple trick, but in case someone didnāt know. In eclipse you can automatically generate getters and setters, generate constructors, etc. Just right click on the program code go to source and you will a lot of useful options
@teleivo, the instructions for IntelliJ no longer work as of the 2017.1 release.
Someone created this ticket (which I will close and point back to Talk), and I verified it also doesnāt work for me. For me I donāt see āEclipse XML Profileā as an import option, and the code formatter is not in IntelliJ format.
If that doesnt exist in 2017.1 it means they removed it which is annoying.
Our formatter xml is from an older eclipse version, you could update that to latest Eclipse and try to import that into 2017.1 intellij. maybe it still supports eclipse xmls but not the older xml version we have.
Formatting is something that I think is a pain and could be improved.
I mean we often have different formatting from intellij/eclipse contributors. Not everyone configures their IDE, is it to combersome, complicated? Or runs the maven build command running the formatter which unfortunately does not format everything (the formatter we use is outdated and our format xml is not well configured for fluent APIs see [TRUNK-5095] - OpenMRS Issues )
Maintaining 2 files for the same thing is annoying. The one we had wasnt updated for fluent/Java 8 style.
I havent yet tried their plugin, its on my todo. But I assume a lot. I mean given the fact that our code does not adhere to our own formatter settings (in Eclipse you could right click in the openmrs-api on src/main/java Source -> Format which will format all and lead to quite a diff). I will try to get more input from others.
Anyone with proven solutions to this is of course welcome to bring them forward