Closed CREITZ25 closed 3 weeks ago
For Adapter for Eclipse Code Formatter
we need to use these settings:
For Save Actions
I prefer to use these settings:
For the Maven Runner
I'd suggest these settings:
For Maven Running Tests
I'm using:
I've added a new branch to ide-settings now: https://github.com/devonfw/ide-settings/tree/dev-ide-settings
Just had a long confusion with @moritzLanger because assertions are failing in his JUnit test.
I was assuming that assertions are enabled via our settings and therefore did not get that the assert
statements in the code were totally wrong (inverted) but never executed when I run the CLI.
What we need to change is to enable assertions in our IDEs (ideally both Eclipse and Intellij and IMHO on all branches).
This is done with the JVM option -ea
for "enable assertions".
I've realized that "Save Actions Tool" is deprecated. It won't work in the latest version of intellij anymore. Looks like we have to remove it from our settings. :( With some luck, we might get its features integrated into intellij later: https://youtrack.jetbrains.com/issue/IDEA-326980
It looks like some more steps are required so that our settings work properly.
F.e. eclipse needs to be pre-installed automatically, otherwise our Adapter for Eclipse Code Reformatter
Plug-In won't work at all.
We also need to make sure that our IDEasy project gets cloned and imported into intellij properly.
Current workflow looks like the following:
devon eclipse
devon intellij
pom.xml
in the root and choose Add as Maven project
All of these steps should be run automatically.
Another issue I've found is the initial clone of the settings when providing the dev-ide-settings git repository URL. It seems like the initial installation of devonfw-ide changed some files in the settings directory and fails to pull the latest version of our dev-ide-settings.
I would propose to change margin/line-length to 160 as we have in Eclipse: https://github.com/devonfw/ide-settings/blob/7d8a9c83ad87b5d0aa060001cfd228b95605ea3f/intellij/workspace/update/.intellij/config/codestyles/Default.xml#L22
Another example: https://github.com/devonfw/IDEasy/pull/187/commits/42ea369595b76e3f14c208430d87473664dddff5
Also I want to get @Override
annotations automatically. I could not figure out how to do this with IntelliJ.
In Eclipse we have this via Save-Actions.
The problem: _* Settings - Editor - Code Style - Java - Tab "Imports":
Names count to use static import with '*': 999_
may be fixed by: https://github.com/devonfw/ide-settings/pull/37
All open tasks (except FolderCompact, since I understood the downside is quite limiting) should be solved by https://github.com/devonfw/ide-settings/pull/38
Confirmed that line wrapping to 160 worked. Thanks @mvomiero
@mvomiero Also Java used for maven seems correct:
For the record: Java is still preconfigured correctly (on Windows or without the current workaround for Mac):
However, the JDK is still not pre-selected automatically:
@ndemirca could you create a PR adding the misc.xml
config that will fix this?
@mvomiero I still do not get warnings for missing JavaDoc:
@mvomiero thanks also for fixing encoding. Seems to work: (also note the yellow/orange mark if someone wants to do a quick and simple nice-to-have improvement)
@mvomiero I still do not get warnings for missing JavaDoc:
That is because I used the settings that were provided in .intellij/config/inspectionProfiles/Project_Default.xml
. I used them since they seemed to be quite precise about the handling of the warnings and so on, donΒ΄t actually know who wrote them, I thought they were project-specific.
Otherwise we can just activate a normal warining for missing javadocs π
.intellij/config/inspectionProfiles/Project_Default.xml
:
<inspection_tool class="MissingJavadoc" enabled="true" enabled_by_default="false" level="WARNING">
<scope enabled="true" level="WARNING" name="Production">
<option name="TOP_LEVEL_CLASS_SETTINGS">
<Options>
<option name="MINIMAL_VISIBILITY" value="package"/>
<option name="REQUIRED_TAGS" value="@param"/>
</Options>
</option>
<option name="INNER_CLASS_SETTINGS">
<Options>
<option name="MINIMAL_VISIBILITY" value="private"/>
</Options>
</option>
<option name="METHOD_SETTINGS">
<Options>
<option name="MINIMAL_VISIBILITY" value="protected"/>
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception"/>
</Options>
</option>
</scope>
</inspection_tool>
I added the warning for missing JavaDoc β οΈ
I substituted the not-working too specific old one in .intellij/config/inspectionProfiles/Project_Default.xml
with a more generic in .intellij/config/inspection/Default.xml
here is the related PR: https://github.com/devonfw/ide-settings/pull/41
I have another demand: When running JUnit tests projects often get the "commandline too long" error what is really annoying. I do not know, why IntelliJ is behaving so bad out-of-the-box but there is a generic solution for the problem that I will illustrate with a screenshot how it can be solved manually in the preferences: We need to apply this manually then figure out in which config files this is written and then add the needed changes to our settings repo to automate this configuration to make IntelliJ usable for Java developers.
To be clarified or fixed if all missing @Override
annotations are automatically added by IntelliJ (maybe missing if protected
or when comming from interface and not superclass TBD).
Created a new pull request: https://github.com/devonfw/ide-settings/pull/49 that should fix the last two problems of this issue:
With these solved, the issue should be finally solved and could be closed π
I do not understand what is going on but I have the impression that we are still far away from our goal. I am on the latest main of our ide-settings and I did re-create my workspace from scratch to verify that its not my personal fault but I am getting this as a result: and also this
So it seems that our efforts in taming IntelliJ are somehow not paying off. This is really annoying. Is there something I could do wrong?
hohwille@CE49454 MSYS /d/projects/IDEasy/settings (main)
$ git log
commit 476b4e70b8690b0f6e22b3f332a285e0446edbc1 (HEAD -> main, origin/main)
Author: jan-vcapgemini <59438728+jan-vcapgemini@users.noreply.github.com>
Date: Mon May 6 17:13:24 2024 +0200
devonfw/IDEasy#154: show project name in intellij (#44)
Seems I am forced to temporary go back to Eclipse since I am blocked and do not want to waste my time with this crappy IntelliJ that always gets into my way.
@hohwille I think the problem is that you are on branch main
and not dev-ide-settings
π
I believe we were speaking about merging the two branches some time ago right? but at the end it never happened.
@hohwille I think the problem is that you are on branch
main
and notdev-ide-settings
π I believe we were speaking about merging the two branches some time ago right? but at the end it never happened.
I created and merged https://github.com/devonfw/ide-settings/pull/50 to avoid such problems and confusions.
There is a simple option for the undesired reformatting of single-line JavaDoc comments causing Diff-Wars:
It seems to be already configured this way: https://github.com/devonfw/ide-settings/blob/5a4f6e225131ad6cfcb035ee1e383fc3f1d3c1e2/intellij/workspace/update/.intellij/config/codestyles/Default.xml#L9
However, what we configure sometimes does not apply.
I have some doubts about how our config looks like...
Why do we have some of these settings in <JavaCodeStyleSettings>
while others are in <codeStyleSettings language="JAVA">
? Is that all some IntelliJ legacy that is really required or are we maybe doing something wrong in our XML structure. Maybe we have to configure this from scratch in an IntelliJ not managed by IDEasy and then create our template from that outcome. In the worst case the XML structure has to be different for various versions of IntelliJ and then we are lost with the approach.
We have already discussed a very long time ago that it would be much smart to do all this with a simple .editorconfig
file instead and ignore the native XML config used by IntelliJ that is undocumented. The .editorconfig
is a more stable "API" to configure IntelliJ more "officially".
Can https://github.com/devonfw/ide-settings/blob/main/intellij/workspace/setup/.idea/saveactions_settings.xml be deleted? Seems not relevant anymore.
Please create issue for XML merger usage of intellij XML configs and move them from setup
to `update.
@mvomiero Also Java used for maven seems correct:
Added new issue for this behaviour: https://github.com/devonfw/IDEasy/issues/601
All open points of this issue were addressed and for the current bugs new issues were created. This issue can be closed now.
As an Intellij user, I want to use Intellij with defaults that make sense to us. To do this, the required settings should be stored in the ide-settings repository.
Optional
: ~FolderCompact plugin could be pre-installed too~ (I initially liked this plugin but it has some severe downsides - if it is installed, you do not see folders likesrc
anymore and if you havesrc/main/assembly
or anything not common you get unable to see this in IntelliJ. This renders the plugin useless even though it would otherwise be great. See my rating comment here)