epam / sap-commerce-intellij-idea-plugin

A plugin for integration of SAP Commerce (aka Hybris) platform with JetBrains IntelliJ IDEA
https://plugins.jetbrains.com/plugin/12867-sap-commerce-developers-toolset/
GNU Lesser General Public License v3.0
54 stars 41 forks source link

Javadoc integration needs improvement #762

Closed fibsifan closed 1 year ago

fibsifan commented 1 year ago
  1. We've noticed that the javadoc URL that can be configured during project setup is also configured for custom extensions which makes no sense, because they're not provided by SAP. Could custom extensions be excluded and not provided with the SAP Commerce Javadoc URL?

    • Workaround: manually remove the javadoc url from all custom extensions after project setup.
  2. We've noticed that the javadoc url also is searched when looking at documentation of other classes such as spring or apache commons utils. The Javadoc is looked up at the configured Javadoc URL and not anywhere else. When decompiling the code of some external library, IntelliJ offers to download sources of the corresponding code, but this is also broken (though working in a spring example project)

    • Currently no known workaround.
mlytvyn commented 1 year ago

@fibsifan , thank you very much for your thoughts and suggestions.

  1. I'll work on that shortly, should not be a big deal.
  2. This one may require some time, will try to figure out what is blocking IntelliJ default functionality.
mlytvyn commented 1 year ago

1st - done in #763

mlytvyn commented 1 year ago

2nd - have you tried import project with these flags? Theoretically, it should automatically download libs sources based on external-dependencies.xml.

image

I've just tried to download sources and it worked well, you can reach me out in Slack and show how it does not work at your side.

image image
fibsifan commented 1 year ago

I tried that some time ago and tried again now. The sources/javadocs weren't downloaded (see screenshots).

I had two exceptions during/after project import (see stactraces below screenshots), maybe that is related?

To add some detail: I always have the SAP Commerce distribution separate from my custom code. In the example project I have

/home/developer/
├ hybris/ -> hybris-2211/
├ hybris-2211/
│ ├ build-tools
│ ├ hybris/
│ │ ├ bin/custom -> /home/developer/src/hybris/bin/custom/
│ │ ├ config -> /home/developer/src/hybris/config/
│ │ └ ...
│ └ ...
└ src/
  └ hybris
    ├ bin/custom/
    └ config/

When importing a project, I select the ~/src/hybris folder (which is versioned in git) and configure ~/hybris/ as the SAP Commerce folder. So lots of Symlinks are involved.

grafik

grafik

java.lang.NullPointerException: get(...) must not be null
    at com.intellij.idea.plugin.hybris.common.services.impl.DefaultVirtualFileSystemService.findFileByNameInDirectory(DefaultVirtualFileSystemService.kt:91)
    at com.intellij.idea.plugin.hybris.project.tasks.SearchHybrisDistributionDirectoryTaskModalWindow.run(SearchHybrisDistributionDirectoryTaskModalWindow.java:67)
    at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:428)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:115)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressSynchronously$9(CoreProgressManager.java:512)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:87)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:251)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:71)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
    at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:71)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:251)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:465)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
    at java.base/java.lang.Thread.run(Thread.java:833)
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Access is allowed from Event Dispatch Thread (EDT) only; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[ApplicationImpl pooled thread 32,4,main] 97437840 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,main] 2005751118
    at com.intellij.openapi.application.impl.ApplicationImpl.createThreadAccessException(ApplicationImpl.java:1083)
    at com.intellij.openapi.application.impl.ApplicationImpl.throwThreadAccessException(ApplicationImpl.java:1078)
    at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1066)
    at com.intellij.ui.SpeedSearchBase.isPopupActive(SpeedSearchBase.java:210)
    at com.intellij.ui.speedSearch.SpeedSearchSupply.getSupply(SpeedSearchSupply.java:55)
    at com.intellij.ui.speedSearch.SpeedSearchSupply.getSupply(SpeedSearchSupply.java:44)
    at com.intellij.ui.speedSearch.SpeedSearchUtil.applySpeedSearchHighlightingFiltered(SpeedSearchUtil.java:185)
    at com.intellij.ui.ColoredTreeCellRenderer.rendererComponentInner(ColoredTreeCellRenderer.java:129)
    at com.intellij.ui.ColoredTreeCellRenderer.getTreeCellRendererComponent(ColoredTreeCellRenderer.java:58)
    at com.intellij.ui.tree.ui.DefaultTreeUI.getRenderer(DefaultTreeUI.java:189)
    at com.intellij.ui.tree.ui.DefaultTreeUI$2.getNodeDimensions(DefaultTreeUI.java:582)
    at java.desktop/javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayoutCache.java:497)
    at java.desktop/javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.updatePreferredSize(VariableHeightLayoutCache.java:1344)
    at java.desktop/javax.swing.tree.VariableHeightLayoutCache.updateNodeSizes(VariableHeightLayoutCache.java:903)
    at java.desktop/javax.swing.tree.VariableHeightLayoutCache.invalidateSizes(VariableHeightLayoutCache.java:371)
    at java.desktop/javax.swing.plaf.basic.BasicTreeUI$Handler.propertyChange(BasicTreeUI.java:3933)
    at com.intellij.ui.tree.ui.DefaultTreeUI$5.propertyChange(DefaultTreeUI.java:712)
    at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:343)
    at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:335)
    at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:268)
    at java.desktop/java.awt.Component.firePropertyChange(Component.java:8759)
    at java.desktop/java.awt.Component.updateGraphicsData(Component.java:1200)
    at java.desktop/java.awt.Container.updateChildGraphicsData(Container.java:1187)
    at java.desktop/java.awt.Component.updateGraphicsData(Component.java:1192)
    at java.desktop/java.awt.Container.updateChildGraphicsData(Container.java:1187)
    at java.desktop/java.awt.Component.updateGraphicsData(Component.java:1192)
    at java.desktop/java.awt.Container.updateChildGraphicsData(Container.java:1187)
    at java.desktop/java.awt.Component.updateGraphicsData(Component.java:1192)
    at java.desktop/java.awt.Component.setGraphicsConfiguration(Component.java:1180)
    at java.desktop/java.awt.Container.lambda$addImpl$0(Container.java:1140)
    at java.desktop/sun.awt.SunToolkit.lambda$performWithTreeLock$1(SunToolkit.java:2139)
    at java.desktop/sun.awt.SunToolkit.performOnMainThreadIfNeeded(SunToolkit.java:2164)
    at java.desktop/sun.awt.SunToolkit.performWithTreeLock(SunToolkit.java:2137)
    at java.desktop/java.awt.Container.addImpl(Container.java:1104)
    at java.desktop/java.awt.Container.add(Container.java:1001)
    at com.intellij.openapi.ui.SimpleToolWindowPanel.setContent(SimpleToolWindowPanel.java:188)
    at com.intellij.idea.plugin.hybris.toolwindow.system.type.view.TSView.refreshContent(TSView.kt:109)
    at com.intellij.idea.plugin.hybris.toolwindow.system.type.view.TSView.access$refreshContent(TSView.kt:41)
    at com.intellij.idea.plugin.hybris.toolwindow.system.type.view.TSView$installSettingsListener$1$2.typeSystemChanged(TSView.kt:91)
    at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:699)
    at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:659)
    at com.intellij.util.messages.impl.MessageBusImplKt.deliverMessage(MessageBusImpl.kt:422)
    at com.intellij.util.messages.impl.MessageBusImplKt.pumpWaiting(MessageBusImpl.kt:401)
    at com.intellij.util.messages.impl.MessageBusImplKt.access$pumpWaiting(MessageBusImpl.kt:1)
    at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:460)
    at jdk.proxy11/jdk.proxy11.$Proxy225.typeSystemChanged(Unknown Source)
    at com.intellij.idea.plugin.hybris.system.type.meta.impl.TSMetaModelAccessImpl$task$1.run$lambda$0(TSMetaModelAccessImpl.kt:103)
    at com.intellij.openapi.project.DumbService.runReadActionInSmartMode$lambda$0(DumbService.kt:76)
    at com.intellij.openapi.project.DumbService.runReadActionInSmartMode$lambda$2(DumbService.kt:117)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:923)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:76)
    at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.kt:110)
    at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.kt:76)
    at com.intellij.idea.plugin.hybris.system.type.meta.impl.TSMetaModelAccessImpl$task$1.run(TSMetaModelAccessImpl.kt:92)
    at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:428)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:115)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:478)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:251)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:71)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
    at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:71)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:251)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:465)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
    at java.base/java.lang.Thread.run(Thread.java:833)
fibsifan commented 1 year ago

I tried importing a commerce cloud project that has the recommended folder structure with core-customize etc, generated with ccv2.

I got the same exceptions and maven dependencies weren't downloaded e.g. for the assertj-core.

mlytvyn commented 1 year ago

@fibsifan , looks like I know what can be the reason to not attached sources - missing library name for jars registered during import and located in the lib folder.

I'll adjust import accordingly.

p.s. you've reported ~4 bugs in one, please split it next time so it will be easier to track and resolve

mlytvyn commented 1 year ago

@fibsifan , 2nd is done - in scope of #764

temporary you can manually change module library name to something and attach the sources.

I'll look to extra issues later.

mlytvyn commented 1 year ago

@fibsifan , 3rd is done - #765.

mlytvyn commented 1 year ago

regarding 4th one I'm not sure how to reproduce that exception.

fibsifan commented 1 year ago

Sorry, It wasn't clear to me from the start, that these are all different issues. I thought the stacktraces might be related to Ctrl+Q not working correctly.

And I thought that the display of documentation was only one feature. Next time I'll make sure to create fine grained issues.

Thanks for the quick responses, that is really impressive!

mlytvyn commented 1 year ago

@fibsifan , I'm closing this ticket, all changes will be included in the upcoming 2023.2.10 release.

If there will be any issues please open new tickets.