Abnaxos / markdown-doclet

A Doclet that allows the use of Markdown in JavaDoc comments.
GNU General Public License v3.0
318 stars 40 forks source link

IDEA plugin fails #59

Open loddar opened 8 years ago

loddar commented 8 years ago

I'm using

IntelliJ IDEA 2016.1.2
Build #IU-145.972, built on May 14, 2016
JRE: 1.8.0_76-release-b162 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

See stack trace:

Assertion failed
java.lang.Throwable
    at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:156)
    at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:165)
    at com.intellij.psi.impl.source.PsiParameterListImpl.getParameterIndex(PsiParameterListImpl.java:50)
    at com.intellij.psi.util.PsiFormatUtil.getExternalName(PsiFormatUtil.java:446)
    at com.intellij.codeInsight.BaseExternalAnnotationsManager.getExternalName(BaseExternalAnnotationsManager.java:80)
    at com.intellij.codeInsight.BaseExternalAnnotationsManager.a(BaseExternalAnnotationsManager.java:208)
    at com.intellij.codeInsight.BaseExternalAnnotationsManager.a(BaseExternalAnnotationsManager.java:146)
    at com.intellij.codeInsight.BaseExternalAnnotationsManager.findExternalAnnotations(BaseExternalAnnotationsManager.java:123)
    at com.intellij.codeInsight.javadoc.JavaDocInfoGenerator.a(JavaDocInfoGenerator.java:918)
    at com.intellij.codeInsight.javadoc.JavaDocInfoGenerator.a(JavaDocInfoGenerator.java:1058)
    at com.intellij.codeInsight.javadoc.JavaDocInfoGenerator.generateDocInfoCore(JavaDocInfoGenerator.java:396)
    at com.intellij.codeInsight.javadoc.JavaDocInfoGenerator.generateDocInfo(JavaDocInfoGenerator.java:437)
    at com.intellij.lang.java.JavaDocumentationProvider.generateExternalJavadoc(JavaDocumentationProvider.java:554)
    at com.intellij.lang.java.JavaDocumentationProvider.generateDoc(JavaDocumentationProvider.java:542)
    > at  ch.raffael.doclets.pegdown.integrations.idea.PegdownDocumentationProvider.generateDoc(PegdownDocumentationProvider.java:134)
    at com.intellij.lang.documentation.CompositeDocumentationProvider.generateDoc(CompositeDocumentationProvider.java:144)
    at com.intellij.codeInsight.navigation.CtrlMouseHandler$9$1.run(CtrlMouseHandler.java:666)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:950)
    at com.intellij.codeInsight.navigation.CtrlMouseHandler$9.run(CtrlMouseHandler.java:661)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:378)
    at com.intellij.util.Alarm$Request.run(Alarm.java:389)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:227)
    at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:187)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Abnaxos commented 8 years ago

Hm. This might be a duplicate of #52. Then again, the failed assertion is the same, but the stack trace is quite different.

Try e75ea23, it should fix #52 and might therefore also fix this. However, I'm still unsure what it breaks. :/ You can build it yourself or use the build I'm currently working with: https://www.dropbox.com/s/17gzqdlu0zd285k/pegdown-doclet-idea-plugin-1.3-1-SNAPSHOT.jar?dl=0

Install the plugin using "Install plugins from disk". Please report any issues with it. If you want to revert to the current release, download it from https://plugins.jetbrains.com/plugin/7253?pr=idea and install from disk again.

Do you know how to reproduce it? Even if the current SNAPSHOT fixes the issue, I'd still like to understand why. :)

loddar commented 8 years ago

Hello Raffael,

I'm working on your doclet. I like to contribute the gist taglet.

I'll dropped the idea-plugin module, because IDEA was all the time complaining.

May be this causes the error. I'll don't know.

Kind regards

Marko

P.S.: I created a branch

Am 03.06.16 um 18:54 schrieb Raffael Herzog:

Hm. This might be a duplicate of #52 https://github.com/Abnaxos/pegdown-doclet/issues/52. Then again, the failed assertion is the same, but the stack trace is quite different.

Try e75ea23 https://github.com/Abnaxos/pegdown-doclet/commit/e75ea230b711a3290314179b1d138c4a2820b417, it should fix #52 https://github.com/Abnaxos/pegdown-doclet/issues/52 and might therefore also fix this. However, I'm still unsure what it breaks. :/ You can build it yourself or use the build I'm currently working with: https://www.dropbox.com/s/17gzqdlu0zd285k/pegdown-doclet-idea-plugin-1.3-1-SNAPSHOT.jar?dl=0

Install the plugin using "Install plugins from disk". Please report any issues with it. If you want to revert to the current release, download it from https://plugins.jetbrains.com/plugin/7253?pr=idea and install from disk again.

Do you know how to reproduce it? Even if the current SNAPSHOT fixes the issue, I'd still like to understand why. :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Abnaxos/pegdown-doclet/issues/59#issuecomment-223633043, or mute the thread https://github.com/notifications/unsubscribe/ABZuLgHPgLOjIQ8Q5GKyeH4XwSUjmF14ks5qIFw2gaJpZM4ItnGm.

Abnaxos commented 8 years ago

I'll dropped the idea-plugin module, because IDEA was all the time complaining.

Create a file local.properties in the project's root with the following contents:

ideaHome=/path/to/your/IDEA/installation

This will add the IDEA Jars to the compile classpath. But if you're not working on the IDEA plugin, removing the module is a viable option. Just take care you don't commit this.

loddar commented 8 years ago

Your plugin does not fail anymore.

loddar commented 8 years ago

Ok. Got the same issue again and again (even with your dropbox version). But now I can tell you when it happens:

If you extend a argument list, for example

anyMethod(val1, val2, cursor is here)

IDEA gives you some suggestions and for each suggestion it generates javadoc. So if will also suggest local variables and parameters. And these have of course no javadoc.

See the attachment idea-plugin-pegdown-doclet--assertion-failure

loddar commented 8 years ago

I got a new error message from the IDEA plugin

Argument for @NotNull parameter 'file' of com/intellij/openapi/roots/impl/ProjectFileIndexImpl.getModuleForFile must not be null
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'file' of com/intellij/openapi/roots/impl/ProjectFileIndexImpl.getModuleForFile must not be null
    at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getModuleForFile(ProjectFileIndexImpl.java)
    at ch.raffael.doclets.pegdown.integrations.idea.DocCommentProcessor.<init>(DocCommentProcessor.java:101)
    at ch.raffael.doclets.pegdown.integrations.idea.PegdownDocumentationProvider.generateDoc(PegdownDocumentationProvider.java:127)
    at com.intellij.lang.documentation.CompositeDocumentationProvider.generateDoc(CompositeDocumentationProvider.java:144)
    at com.intellij.codeInsight.navigation.CtrlMouseHandler$9$1.run(CtrlMouseHandler.java:666)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:950)
    at com.intellij.codeInsight.navigation.CtrlMouseHandler$9.run(CtrlMouseHandler.java:661)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:378)
    at com.intellij.util.Alarm$Request.run(Alarm.java:389)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:227)
    at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:187)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)