Copyright and Coverage report plugins missing from WebStorm?
Answered
I'm hoping someone from JetBrains might have some insight into this. When I recently extended my custom language plugin to support WebStorm in addition to IntelliJ IDEA, I was surprised to find that the Copyright plugin was missing from WebStorm given that it's distributed with IntelliJ IDEA Community Edition. Now it's also looking like the Coverage report functionality is also missing from WebStorm.
Are these omissions intentional or an oversight? Again, it just seems odd that they'd be present in the free version of IntelliJ IDEA and not in a for-pay IDE, especially when coverage itself is available, just not report generation.
Thanks much for any insight you can provide!
Scott
Please sign in to leave a comment.
Copyright plug-in is included in WebStorm. Coverage plug-in is mostly for Java apps, therefore it makes no sense for WebStorm.
Thanks, Serge.
Did the inclusion of the Copyright plugin change recently? I'm sure it wasn't there in mid-December. I guess it doesn't matter since that "problem" is now resolved.
As for coverage, the feature is included with WebStorm already, just not the ability to generate reports from coverage data. If you look in the WebStorm lib directory you'll see coverage-agent.jar, coverage-instrumenter.jar, and coverage-util.jar. All of the coverage-related functionality of my third-party plugin works great in WebStorm...except for report generation. Why include most of it but not the reporting ability when that's available in the free version of IntelliJ IDEA? Again, it seems like an oversight.
Regards,
Scott
Hi Scott,
that seems strange as report generation works ok for built-in plugins. If there's coverage data selected in Run | Show Code Coverage Data, there's an action to generate a report. Does your engine override com.intellij.coverage.CoverageEngine#isReportGenerationAvailable? Does it return true in WebStorm?
Hi, Dennis. Yes, I have that overridden and had it returning true pretty much unconditionally until a WebStorm user pointed out that it didn't work. The root cause is a number of NoClassDefFoundErrors. When I look at my CoverageEngine implementation against the WebStorm SDK, key classes such as HTMLReportBuilder, ReportBuilderFactory, ClassInfo, CoverageSourceData, ReportGenerationFailedException, etc., aren't available. That's why I'm assuming that the reporting portion of the SDK isn't available in the lesser plugin SDK.
For the moment I have isReportGenerationAvailable() returning true only for IntelliJ so that users don't run into this issue.
Thoughts?
Thanks,
Scott
Oh, now I get it. Looks like all report generators that are used in minor IDEs (e.g. Ruby, Python, etc) do not use HTMLReportBuilder as it seems to be more or less Java-specific (namespaces, classes, stuff like this). So it was not an oversight, but probably we'll need to extract some additional things too, I'll ask my colleague about that.
Gotcha. Glad that helped clarify it. And if there's some other set of reporting classes I should be using with the minor IDEs, could you provide a pointer? I'm fine taking that approach as well. I just didn't see anything obvious when I looked. Could be my own oversight/ignorance of the underlying differences.
They're mostly reusing report generation capabilities of underlying tools (e.g. launching coverage with special parameters), so there's not much to reuse.
You can try bundling coverage-report.jar and related jars into your plugin so you won't have to rewrite report generation code. We'd like to avoid bundling it into minor IDEs in order not to increase distribution size.
Thanks, Dennis. I did try that (as did a few of my plugin's user) and it didn't work. I don't know if there might be some signing mismatch or something else. Any thoughts on that?
Worst case scenario I'll just disable the feature if it can't find these key classes in the classloader. That way if/when WebStorm has access to them, it will just start working.
What error do you get in that case? I think you should also add freemarker.jar for it to work
Dennis, I've verified that report generation works in WebStorm by adding coverage-report.jar, coverage-report-idea.jar (not 100% sure this one is required), and freemarker.jar. I'd also prefer not to include it in my plugin distribution as it's the same distribution for IntelliJ IDEA as for WebStorm, so I'm going to document for users how can they add it to WebStorm's lib directory (unless you would suggest a better way to do it outside of WebStorm and outside of my own plugin).
One more quick update. I verified that coverage-report-idea.jar is not needed, and I also verified that you can add the other two jars to my plugin's lib directory and it works. That's preferable in that it doesn't muddy the application distribution directly, but the down-side is that I'm pretty sure it's lost each time the plugin is updated (though I'm not 100% sure about that).
Hi,
I think I have the latest WebStorm version and I cannot find the copyright plugin. I can find it in intellij but not in WebStorm.
Thank you
It's available by default:
Make sure it's enabled in the list.
If you still can't see this plug-in, reinstall WebStorm.
I think Dennis D. may be having the same experience I did. I can't explain what happened, but I also didn't find a Copyright plugin in my WebStorm install on multiple machines. Then later after Serge said that it should be there, I saw that it was. Like I said, I can't explain it, but I did reproduce it multiple times. I don't know if it was earlier builds or what. I have not seen the issue since seeing it seemingly resolved, though. Given that two people are now seeing this, there's definitely something to the issue...
I reinstalled WebStorm and I didn't import the old configurations and it worked!
Thank You