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

Broken Spell Checker #575

Closed marekoti closed 6 years ago

marekoti commented 6 years ago

The built-in IntelliJ spell checker is not working inside md files. Interestingly it's working but just in header's text. It's working just fine in any other files, including newly created plain .txt files. Version used (the most recent one as of today): 2.5.2.

marekoti commented 6 years ago

After switching off the Markdown Navigator plug-in spell checking works a treat. Likewise when using IntelliJ's plug-in for markdown.

vsch commented 6 years ago

@marekoti, can you please give more information on the IDE and version that you are using and the operating system. I tested it with IDEA 2016.3.8, 2017.3, 2018 EAP, Php 2018 EAP, WebStorm 2018 and all work.

marekoti commented 6 years ago

Oh good point, sorry forgot to mention that. I'm on the latest stable version of Android Studio, i.e. 3.0.1, which is based on IntelliJ IDEA 2017.1.2.

vsch commented 6 years ago

@marekoti, thank you for the feedback. I will have to try it on Android studio. Although it is based on IDEA 2017.1.2, it could have made changes to some internals that affect plugin implementations.

I encounter such changes from version to version of JetBrains IDE releases so would not be surprised if the same applies to Android studio.

Looks like I will need to add Android Studio to my testing platform list.

marekoti commented 6 years ago

Technically Android Studio is just a plugin for IntelliJ, not a fork, at least that's how it was described at its launch: https://blog.jetbrains.com/idea/2013/05/intellij-idea-and-android-studio-faq/ I also don't think it provides any specific support/behaviour for md files. Hence I wouldn't expect it to be Android Studio specific.

vsch commented 6 years ago

@marekoti, often in software the marketing glossy differs from implementation reality.

I installed Android Studio 3.0 and can already see that JavaFX support in the plugin has issues. On my system it tries to download JavaFX support (implemented for very early JetBrains bundled JDKs) which should not happen for Android studio. This causes JavaFX to fail.

I will debug the plugin under Android studio to check for differences.

Spell checking, however is working on my system.

marekoti commented 6 years ago

Can that JavaFX issue be anyhow related to the spellchecker issue I'm experiencing? Could any more information like logs etc assist with investigation? Please see the screenshot below showcasing the problem: markdownnavigatorspellcheckerbug

vsch commented 6 years ago

@marekoti, no the javafx is related to lack of scroll preview to source position.

However, the screenshot is showing that spell checker is working. It is showing an error. If you open the yellow bulb for intentions, does it show the Typo: Rename To: intention?

marekoti commented 6 years ago

Well no, it's not working mostly, as mentioned in the bug description it's only working for headers. As you can see exactly the same tyypo is not highlighted above in the paragraph text.

vsch commented 6 years ago

@marekoti, I released an EAP plugin version to fix the erroneous detection of JavaFX for Android Studio which does not have javafx and the download attempted by the plugin is for an old release of IDEA, which does not work for Android Studio.

The spellchecking works with exact text used as far as I can see in the snapshot.

screen shot 2018-03-21 at 3 34 07 pm

There must be some other difference or setting that would be causing the issue on your system. You can try the EAP version to see if it makes a difference but I suspect that this issue is from something else that I have not been able to duplicate yet.

To enable EAP update channel:

  1. Select "Early Access Program" in Check updates for:
  2. Then make the IDE check for updates.

Screen Shot Settings Update Channel

marekoti commented 6 years ago

Installed the EAP version, unfortunately that hasn't fixed the spellchecking issue I'm experiencing. I've checked with your settings and they look pretty much the same as mine. I haven't changed anything, basically it's both fresh installation of Android Studio on a new machine and fresh installation of Markdown Navigator. The only difference is that I see "Installed version: 2.5.2.4" and some options are not available for me as I haven't upgraded yet to the paid license (indeed that issue is stopping me from upgrading). Please let me know if you need more info from me.

vsch commented 6 years ago

@marekoti, that last piece of information allowed me to duplicate the issue. Unlicensed plugin does not have all the elements parsed. The latest improvements in the plugin's spellchecking broke the spell checking for basic plugin.

Thank you for sticking with the issue to allow me to duplicate the issue.

I will fix it and make a fixed release.

marekoti commented 6 years ago

Nice one, glad that we got to the bottom of the issue! Good luck with the fix! Do you know which was the last working version? In the meantime I may use it.

vsch commented 6 years ago

@marekoti, being able to duplicate the symptom is 90% of the problem resolution.

Give me a few more minutes and I will make an EAP release. I already have it fixed.

screen shot 2018-03-22 at 12 57 39 pm
vsch commented 6 years ago

@marekoti, EAP update with a fix for the issue is available.

marekoti commented 6 years ago

It works now but correcting typo doesn't work (no matter if used through context menu/refactor/rename, the light bulb or alt+enter) -- please see the attached screenshot. Also the spellchecker is very slow. It takes a few (~6) seconds for it to change upon both creating and correcting a typo. That shoudn't matter but I tested it in a small doc (<1k chars). IntelliJ's Markdown Support plugin is nearly instant with spellchecking. Until those two issues are fixed, I will stay using the IntelliJ's plugin. cannotperformrefactoring

marekoti commented 6 years ago

The caret is obviously positioned at the symbol (inside the misspelled word).

marekoti commented 6 years ago

OK regarding the performance, probably a more through tests/comparison should be conducted as actually I can observe even the simple Markdown Support plugin from IntelliJ, having locationally a few seconds lag. Still most of the time it is nearly instant. I haven't thoroughly tested Markdown Navigator, but just checked a few times that one typo example and was observing ~6s lag for that case.

vsch commented 6 years ago

@marekoti, the spell checking highlighting is performed after syntax highlighting. If you change the syntax highlighter to Lexer then it will happen as you type. Lexer set to annotator adds a delay for syntax highlighting but allows better typing response in large files.

screenshot_settings_syntaxhighlighter

Still trying to duplicate your inability to use correction. So far no luck. However, why are you getting "rename/refactoring" since the type is not an element that can be renamed. You should see a Typo: Change to: not Typo: Rename to: This is the problem. Text cannot be refactored since it is not a named element.

screen shot 2018-03-23 at 8 58 57 am screen shot 2018-03-23 at 8 59 33 am
marekoti commented 6 years ago

OK maybe it's related to the fact that earlier I've as well installed RedPen, Thesaurus, and Gfm plugins? I'm pretty sure I was testing with them disabled as well and observed the same. Maybe restarting with clearing caches would be needed? When it comes to the RedPen plugin I had to download it directly from IntelliJ page as weirdly it didn't work from the IDE itself.

vsch commented 6 years ago

@marekoti, depending on how plugins implement their functionality, it is possible for plugins to conflict and cause issues because the API is huge and usually assumptions are made or guessed at how it is used. Often this assumption is too simplistic.

I have hit on this reality many times. Additionally, the IDE does have bugs and these also add to the failures, which are readily blamed on the plugin that exposes it because statistically, it is most likely a plugin issue but not always. :)

marekoti commented 6 years ago

I understand that. Please let me know if there's anything I can do to help with the investigation.

manovotny commented 6 years ago

@vsch I wound up here with the same problem. Updating to the EAP brought back the squiggly underline, but I too could not cannot get Alt + Enter to work for suggestions.

correct-spelling-alt-enter

This was happening on version 2.5.2.20 of Markdown Navigator using IntelliJ IDEA Ultimate 2017.3.4 (Build #IU-173.4548.28).

However, when I updated to IntelliJ IDEA Ultimate 2018.1.4 (Build #IU-181.5087.20), Alt + Enter started to work for me again. 🎉

I don't know if this helps isolate an issues with older versions of JetBrains projects, but it's working for me again now being on the latest of everything, which makes me really happy! 😊

Please let me know if you need any additional information from me or if there is anything else you'd like me to try so I can help isolate the issue for you further, if needed.

vsch commented 6 years ago

@manovotny, thank you for letting me know. I will try it on an older version. I have 2016.3.8 and 2017.3. installed.

There are so many changes between versions of the IDE and types of IDE that I cannot keep up with the "idiosyncrasies". It is also getting harder to support older versions since 2018.1 has a lot of changes and more coming in 2018.2, some of which are breaking changes. Meaning, I would either have to raise the version cut-off or have multiple versions of the plugin. One for older IDEs.

manovotny commented 6 years ago

@vsch I personally have zero issues with needing to use up to date things for everything to work properly, but I can completely empathize with the countless variations. It's difficult to make everyone happy and stay happy yourself. In the end, this plugin is amazing and I appreciate the time you put into it. Do that best you can and do what's best for you! ❤️

vsch commented 6 years ago

@manovotny, thank you for the kind words.

I have to admit that I enjoy using the plugin myself. I set out to make my life documenting projects less tedious. I never imagined I could enjoy doing documentation.