Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ide-settings broken for IntelliJ or bug in XML merger #640

Closed
hohwille opened this issue Sep 20, 2024 · 2 comments · Fixed by #643 or #644
Closed

ide-settings broken for IntelliJ or bug in XML merger #640

hohwille opened this issue Sep 20, 2024 · 2 comments · Fixed by #643 or #644
Labels
blocker bug Something isn't working configuration should be configurable or configuration change intellij IntelliJ IDE from Jet-Brains

Comments

@hohwille
Copy link
Member

I updated my IDEasy project and wanted to start intellij:

$ ide intellij
Configuring workspace main for IDE intellij
An unexpected error occurred!
We are sorry for the inconvenience.
Please check the error below, resolve it and try again.
If the error is not on your end (network connectivity, lack of permissions, etc.) please file a bug:
https://github.com/devonfw/IDEasy/issues/new?assignees=&labels=bug&projects=&template=bug.md&title=IllegalStateException%3A+No+merge%3Aid+value+defined+for+element+%2Fprofile%2Finspection_tool+in+document+D%3A%5Cprojects%5CIDEasy%5Csettings%5Cintellij%5Cworkspace%5Cupdate%5C.intellij%5Cconfig%5Cinspection%5CDefault.xml
java.lang.IllegalStateException: No merge:id value defined for element /profile/inspection_tool in document D:\projects\IDEasy\settings\intellij\workspace\update\.intellij\config\inspection\Default.xml
        at com.devonfw.tools.ide.merge.xmlmerger.model.MergeElement.getId(MergeElement.java:95)
        at com.devonfw.tools.ide.merge.xmlmerger.matcher.ElementMatcher.matchElement(ElementMatcher.java:51)
        at com.devonfw.tools.ide.merge.xmlmerger.MergeStrategy.combineChildNodes(MergeStrategy.java:155)
        at com.devonfw.tools.ide.merge.xmlmerger.MergeStrategy$1.merge(MergeStrategy.java:30)
        at com.devonfw.tools.ide.merge.xmlmerger.XmlMerger.merge(XmlMerger.java:103)
        at com.devonfw.tools.ide.merge.xmlmerger.XmlMerger.merge(XmlMerger.java:78)
        at com.devonfw.tools.ide.merge.DirectoryMerger.merge(DirectoryMerger.java:65)
        at com.devonfw.tools.ide.merge.DirectoryMerger.merge(DirectoryMerger.java:69)
        at com.devonfw.tools.ide.merge.DirectoryMerger.merge(DirectoryMerger.java:69)
        at com.devonfw.tools.ide.merge.DirectoryMerger.merge(DirectoryMerger.java:69)
        at com.devonfw.tools.ide.merge.DirectoryMerger.merge(DirectoryMerger.java:69)
        at com.devonfw.tools.ide.tool.ide.IdeToolCommandlet.configureWorkspace(IdeToolCommandlet.java:82)
        at com.devonfw.tools.ide.tool.ide.IdeToolCommandlet.run(IdeToolCommandlet.java:47)
        at com.devonfw.tools.ide.context.AbstractIdeContext.applyAndRun(AbstractIdeContext.java:856)
        at com.devonfw.tools.ide.context.AbstractIdeContext.run(AbstractIdeContext.java:765)
        at com.devonfw.tools.ide.cli.Ideasy.runOrThrow(Ideasy.java:89)
        at com.devonfw.tools.ide.cli.Ideasy.run(Ideasy.java:52)
        at com.devonfw.tools.ide.cli.Ideasy.main(Ideasy.java:29)
        at java.base@21.0.2/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)


Error: IDEasy failed with exit code 255

Seems to relate this this file:
https://github.com/devonfw/ide-settings/blob/main/intellij/workspace/update/.intellij/config/inspection/Default.xml

For me the error does not really make sense.
Is there a new bug we found in XML merger?

@hohwille hohwille added the bug Something isn't working label Sep 20, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Sep 20, 2024
@hohwille hohwille added blocker intellij IntelliJ IDE from Jet-Brains configuration should be configurable or configuration change labels Sep 20, 2024
@hohwille hohwille added this to the release:2024.09.002 milestone Sep 20, 2024
@hohwille
Copy link
Member Author

BTW: We should have an option (e.g. --skip-workspace-update) that skips the workspace update so we do not end up with blocker bugs preventing users to launch IntelliJ after all.
However, if you skip ide as proxy command and just run intellij you can still open the IDE.

hohwille added a commit to hohwille/IDEasy that referenced this issue Sep 20, 2024
hohwille added a commit to hohwille/IDEasy that referenced this issue Sep 20, 2024
hohwille added a commit to hohwille/IDEasy that referenced this issue Sep 20, 2024
hohwille added a commit to hohwille/IDEasy that referenced this issue Sep 20, 2024
this is O(n^2) and also current code removes merge:* attributes in updateAndRemoveNsAttributes so the parent could be modified and merge:strategy been removed
hohwille added a commit to hohwille/IDEasy that referenced this issue Sep 22, 2024
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in IDEasy board Sep 23, 2024
@jan-vcapgemini
Copy link
Contributor

jan-vcapgemini commented Sep 23, 2024

It looks like adding the merge:id for @class on the first element does not work for the other inspection_tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker bug Something isn't working configuration should be configurable or configuration change intellij IntelliJ IDE from Jet-Brains
Projects
Status: ✅ Done
2 participants