vsch / idea-multimarkdown

Markdown language support for IntelliJ IDEA.
https://plugins.jetbrains.com/plugin/7896-markdown-navigator
Apache License 2.0
815 stars 127 forks source link

Not working in version 14.0.3 #15

Closed tveon closed 9 years ago

tveon commented 9 years ago

The current "Compatible builds" information is: 134.549. I tried installing it on a version 14.0.3 build 139.1117. Launching it here fails with two occurences of java.lang.NoClassDefFoundError: com/intellij/ide/scratch/ScratchFileService

Scratch Files were introduced in version 14 of IntelliJ IDEA, so it is not entirely clear to me, why this is happening. There could of course have been a refactoring with the enhancements in 1.41, which have either added or moved the class... Depending of where the problem arises, it might not be feasible to fix. But then the compatibility information should be updated to reflect that you need a recent version. (I don't know how these build-numbers change between Community and Ultimate editions, though.)

Full stack-trace:

java.lang.NoClassDefFoundError: com/intellij/ide/scratch/ScratchFileService
    at com.vladsch.idea.multimarkdown.editor.MultiMarkdownPreviewEditorProvider.accept(MultiMarkdownPreviewEditorProvider.java:49)
    at com.vladsch.idea.multimarkdown.editor.MultiMarkdownPreviewEditorProvider.accept(MultiMarkdownPreviewEditorProvider.java:66)
    at com.intellij.openapi.fileEditor.impl.FileEditorProviderManagerImpl$2.compute(FileEditorProviderManagerImpl.java:92)
    at com.intellij.openapi.fileEditor.impl.FileEditorProviderManagerImpl$2.compute(FileEditorProviderManagerImpl.java:89)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:920)
    at com.intellij.openapi.fileEditor.impl.FileEditorProviderManagerImpl.getProviders(FileEditorProviderManagerImpl.java:89)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.c(FileEditorManagerImpl.java:963)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4(FileEditorManagerImpl.java:768)
    at com.intellij.openapi.fileEditor.impl.EditorsSplitters$UIBuilder.processFiles(EditorsSplitters.java:855)
    at com.intellij.openapi.fileEditor.impl.EditorsSplitters$UIBuilder.processFiles(EditorsSplitters.java:830)
    at com.intellij.openapi.fileEditor.impl.EditorsSplitters$ConfigTreeReader.process(EditorsSplitters.java:821)
    at com.intellij.openapi.fileEditor.impl.EditorsSplitters.openFiles(EditorsSplitters.java:245)
    at com.intellij.openapi.fileEditor.impl.OpenFilesActivity.runActivity(OpenFilesActivity.java:35)
    at com.intellij.ide.startup.impl.StartupManagerImpl$2.run(StartupManagerImpl.java:146)
    at com.intellij.ide.startup.impl.StartupManagerImpl.b(StartupManagerImpl.java:303)
    at com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartupActivitiesFromExtensions(StartupManagerImpl.java:151)
    at com.intellij.openapi.project.impl.ProjectManagerImpl$8.run(ProjectManagerImpl.java:471)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:410)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:621)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$7.run(ProgressManagerImpl.java:422)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$3.run(ProgressManagerImpl.java:194)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:281)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:233)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:181)
    at com.intellij.openapi.application.impl.ApplicationImpl$10$1.run(ApplicationImpl.java:641)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:406)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:695)
    at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)
vsch commented 9 years ago

I will update the build information if there is no way to make it work with earlier builds sans scratch files. This was a quick fix and I forgot to verify if the scratch file service was available in earlier versions.

Sorry about that. I'll try to get it fixed ASAP.

tveon commented 9 years ago

Thanks for the quick reply. :+1:

vsch commented 9 years ago

New build up on the official site. For some reason the scratch file associations have changed in the newest releases and when you select the file type you want the passed file to the plugin does not have this association. You have to look for it in the ScratchFileService mappings.

Solved by dynamically calling the needed methods through reflection since they are only needed on the newest releases but caused the exception you encountered on older IDEA's.

I checked and the earliest build that works is actually IDEA 13 build 135.549, settings custom css editor loads funny the first time you open the settings, line numbers don't show up. However, subsequent settings show everything correctly. Let me know if this build works for you.

tveon commented 9 years ago

Works like a charm.

luyseyal commented 9 years ago

I'm on IDEA 13 135.1289 and still experiencing this issue with a fresh download/install.

1:55:18 PM NoClassDefFoundError: com/intellij/ide/scratch/ScratchFileService: com/intellij/ide/scratch/ScratchFileService

vsch commented 9 years ago

@luyseyal, I don't know how you can install the latest release it was set for build 135.1306 and up. The earlier builds like 133.1701 have no combobox. All works but settings and I did not have the energy nor the time to get that fixed so I bumped up the build number. I am fixing it now and the next release with a few bug fixes and a changed since build all the way down to 133.1711, that is the earliest I have for IDEA 13.0 CE, will be coming out shortly.

I think in this next build all the NoClassDefFoundError(s) are handled.

luyseyal commented 9 years ago

@vsch Wow, thank you!

vsch commented 9 years ago

You are welcome.

vsch commented 8 years ago

@tamboril, thank you for reporting this. I will download latest CLion and try it. What OS are you using?

and opened a new issue #105 for this since it is different from this old issue. Please switch over to #105 for updates