vsch / idea-multimarkdown

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

πŸŽ‰ 2019.3 Compatible MdNav 2.9.9 Released πŸŽ‰ #785

Closed vsch closed 4 years ago

vsch commented 4 years ago

2019.3 Beta has many breaking changes for Markdown Navigator.

The currently released plugin will not work in that release.

Unfortunately the biggest break is caused by the new version of Kotlin bundled with the IDE and requires removing a library used by the plugin for wrapping text and formatting. Which means it is more like open heart surgery than an ingrown toe nail removal.

I am working on it and will make a compatible release as soon as possible.

As usual, there was no hint of a problem in any of the EAP releases until Beta was rolled out and broke the plugin.

vsch commented 4 years ago

Some good progress. I ported the code for wrapping paragraphs, which was the only functionality I did not have in flexmark-java library. This was the hurdle keeping the old beast in play.

I translated the class into Java and removed all the "smart" cacheing and lazy computations. Now just set values and ask for recompute. The new version is a speed demon. The tests are still original Kotlin, except now each test recomputes wrapping twice. Once for comparison and another time for the printout to console. So Java does 2x as many reflows as old Kotlin.

The first time I ran the test for new implementation, it passed but I thought something was wrong it just flashed the output.

Here is a gif or Java test, 365 ms for 720 text wrapping computations:

NewParagraphTest

vs. the old version, 6 sec 916 ms with only 360 text wrapping computations:

OldParagraphTest

vsch commented 4 years ago

The progress of this issue has been slower than I wanted but well worth the time it takes. So far tons of bugs were fixed and lots of new tests added to help with the final replacement of the library.

Tons of optimizations were added as part of the cleanup and preparation for the replacement. From experience I know it is easier to do major surgery on cleaned up code than messy one so I chose to spend more time up front in the cleanup and preparation rather than on the tail end testing and debugging.

One major improvement is resolved link cache for files. This allows links which do not change to not use the slow link resolution methods but to use the cached resolved target. Result is staggering. Files with lots of image links used to be very slow on typing response because each preview update needed to resolve all the image links to targets. Now there is no lag at all.

This one was a big issue which bothered me for a couple of years but caching resolved links was not doable without having a reliable way of invalidating them.

The next release going to have significant stability, performance and usability improvements.

vsch commented 4 years ago

Here is an example of speed up from link caching. I got this huge project from a user for #707. And I use it as a tank-test-bed for markdown rendering. The project is huge. 27000 text files and 1100 markdown files so link resolution is slow.

Typing in a file with only 13 images with and without link caching:

WithLinkCaching

The jumpiness without caching is the pause in UI response as the preview is updated and does image link resolution.

NoLinkCaching

toby-griffiths commented 4 years ago

Just wanted to say thanks for working on this. I've just setup a new PHPStorm install on my new laptop, and it's loading v1.5.0 of the plugin, rather than anything more recent… and now my old laptop has synced the settings and reverted the old version of the plugin 😩

vsch commented 4 years ago

@toby-griffiths, sorry about that. I tried to remove old versions and set their until build but the interface in the plugin marketplace only lets you do one version at a time. After which it shows again the collapsed version list that you have to keep hitting more.

I am just going to delete all the old plugin versions and only leave latest versions for each minimum supported build. This will not help you but at least it will prevent the settings from being blown away again.

I am hoping delete will go faster than unlisting them. I have a lot to remove:

toby-griffiths commented 4 years ago

Wow that was a quick response. Thanks. And thanks again for the great plug-in.

vsch commented 4 years ago

@toby-griffiths, I tried to remove a version and got an e-mail asking to confirm. So I replied and asked to have all the unlisted and old versions removed.

I too was bitten by this when some latest plugin was not compatible with the IDE. The IDE recommended something from the crypt as an alternative. I did not pay attention and updated to that version. It crashed the IDE. Now I keep my eyes peeled for recommended plugin versions to make sure they were built at least after the dark ages.

I reported this issue with recommended plugin updates but don't know when and if it will be addressed.

vsch commented 4 years ago

@toby-griffiths, I found the YouTrack issue regarding the IDE suggesting vintage versions for plugin upgrade, two months ago when this problem bit me on an incompatible plugin.

Feel free to up vote it: IDEA-225205: Incompatible Plugin suggested as update version

vsch commented 4 years ago

I am preparing an EAP release of 2019.3 compatible version for later today.

I did not complete all rework but have all the features working, including wrap on typing. It is an improved version, especially since there is not one for 2019.3.

vsch commented 4 years ago

EAP update with a fix for the issue is available.

Installing EAP Plugin Version

toby-griffiths commented 4 years ago

Thanks @vsch. It's much appreciated. The only problem is that the plugin's no longer appearing in my market place. I'm guessing this is because you've remove the really old version that's 'compatible' with my 2019.3 version. Is there a way to install the EAP manually?

vsch commented 4 years ago

@toby-griffiths, actually the EAP channel is only manual or plugin setup. I forgot that for this version in-plugin setup is not available. Duh!

You can download the zip here: https://github.com/vsch/idea-multimarkdown/blob/master/dist/idea-multimarkdown.2.9.7.233.zip and install it manually.

I will upload the plugin to the EAP version to the EAP channel in the market place.

vsch commented 4 years ago

@toby-griffiths, thank you bringing this to my attention. I missed this nuance.

Added EAP channel to plugin in the market place: https://plugins.jetbrains.com/plugin/7896-markdown-navigator/versions

toby-griffiths commented 4 years ago

Thanks. I'm afraid I still can't see how to install the EAP version in my PHPStorm version. Do I need the EAP version of PHPStorm?

vsch commented 4 years ago

@toby-griffiths, you need to

  1. download the plugin from this repo dist directory or from the plugin market place EAP channel.

    ⚠️ DO NOT UNZIP THE DOWNLOADED ZIP

    image

  2. Then go to plugins settings in the IDE and select install plugin from disk and in the file browser select the zip file downloaded in step 1.

    image
vsch commented 4 years ago

@toby-griffiths, I will be making a stop gap stable release version later today, as soon as I have the EAP reported issues cleaned up. A stop gap stable version is better than all this mucking around with EAP and downloads.

vsch commented 4 years ago

@toby-griffiths, version 2.9.8 has been rushed out and should be available for install and update in 2019.3 IDEs.

toby-griffiths commented 4 years ago

That's amazing. Thank you. You're a 🌟