Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to ignore code in Markdown using spellright.ignoreRegExps? #24

Closed
borekb opened this issue Jul 4, 2017 · 11 comments
Closed

How to ignore code in Markdown using spellright.ignoreRegExps? #24

borekb opened this issue Jul 4, 2017 · 11 comments

Comments

@borekb
Copy link
Contributor

borekb commented Jul 4, 2017

I want to suppress spell checking inside Markdown code words and I've got a feeling that spellright.ignoreRegExps will be the way to go, however, I can't figure out how to write that regexp. Could you provide an example please? Is it possible at all? I've tried:

    "spellright.ignoreRegExps": [
        "/`.*`/g"
    ]

which doesn't seem to work.

Thanks for an awesome extension BTW.

@bartosz-antosik
Copy link
Owner

Sadly these regular expressions cannot do the work. They are matched after separation of the lexemes (words) at exactly the same place as ignoreWords.

I have added this to Markdown parser and it should now ignore inline code parts in version 1.0.24.

bartosz-antosik added a commit that referenced this issue Jul 5, 2017
@bartosz-antosik
Copy link
Owner

Please let me know if code ignoring in version 10.24 works for you.

@borekb
Copy link
Contributor Author

borekb commented Jul 6, 2017

Yes it's working great! On a similar front, I think the links in MD link syntax should also be skipped:

[test](http://example.com)
       ^^^^^^^^^^^^^^^^^^ don't spell check this

To overload this comment even more, is there an easy way to add some words to ignoreWords or do I need to do that manually?

@bartosz-antosik
Copy link
Owner

This is strange - e-mails & URL should be excluded from spelling (globally) from version 1.0.10. Could you please provide an example URL that is spelled?

No, there is no menu for adding this. This has to be done manually. This is a bit "by design" as I was aiming in as low-profile GUI as possible. Also I am not sure if it is possible to have information about word under cursor when providing context menu actions - if it would all spellcheckers would use this instead of adding diagnostics to the list. This would allow to scan for proper forms of words while popping the menu, which would speed spelling a lot - currently it takes a lot of time to provide correctly spelled words than to check if the word is spelled correctly or not.

@bartosz-antosik
Copy link
Owner

But maybe you are right - there could be an action, probably with unassigned key to add word to ignored word list. Let me think this through.

@borekb
Copy link
Contributor Author

borekb commented Jul 6, 2017

You're right, URLs are not spell checked, my actual examples are relative links like this:

image

@bartosz-antosik
Copy link
Owner

If I could please get this in text! ;-)

@borekb
Copy link
Contributor Author

borekb commented Jul 6, 2017

- [PhpStorm setup](#phpstorm)
- [Writing code](#writing-code)
- [Debugging](#debugging)
- [Testing](#testing)
- [Frontend development](#frontend-development)
- [Production build](#production-build)
- [Docker tips](#docker-tips)

@bartosz-antosik
Copy link
Owner

Wait! I have missed one important thing - when you have a word underlined as misspelled then once you press correct button (Ctrl+.) you get a menu with suggestions which has two last items "Add "misspelled" to Workspace ignore list" and "Add "misspelled" to global ignore list" - have you considered these?

add-to-ignore

I tend not to use custom dictionaries (a.k.a. Ignore Lists). That's maybe why I have forgot them.

@borekb
Copy link
Contributor Author

borekb commented Jul 6, 2017

OMG how could I have missed this? :) Exactly what I'm looking for.

@bartosz-antosik
Copy link
Owner

Seems close. I will close this thread, please examine these and report if that's very off what you need. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants