errata-ai / vale-vscode

A Visual Studio Code extension for the Vale CLI.
https://marketplace.visualstudio.com/items?itemName=errata-ai.vale-server
MIT License
53 stars 18 forks source link

Once correction is made, then it stops working properly and you can add nonsense that is not linted #41

Open David-Else opened 3 years ago

David-Else commented 3 years ago
Linux
vale version 2.6.6 (directly downloaded)
VS Code 1.52

.vale.ini
[*.md]
BasedOnStyles = Vale, Microsoft

I am using the CLI version, not the server.

On the following line, I get an error Use 'what's' instead of 'What is'.ValeMicrosoft.Contractions

“What is that pink mist coming out of the engine?” asked Alice.

So I correct to:

“What's that pink mist coming out of the engine?” asked Alice.

and I save, the red squiggle goes away. Now add:

"What'ssssssss that pink mist coming out of the engine?” asked Alice."

and hit save... NOTHING, no red squiggle.

You can add all sorts of nonsense at the end and it does not work. There is definitely a bug! It is not just for this sentence, I have encountered it often.

PS Awesome free software, thanks!

ChrisChinchilla commented 3 years ago

@David-Else Couple of things here to help us debug this.

ValeMicrosoft.Contractions for the style you're using… That is strange syntax, is that a custom style you've created?

Do you have a copy of the Microsoft style locally? I don't see any paths in your ini file.

I can't speak for the "all sorts of nonsense" as I'm not sure what you're putting, but for "What'ssssssss, that's a spelling error, not a contraction, do you have a rule enabled for checking spelling?

David-Else commented 3 years ago

Hi, I don't know what you mean by ValeMicrosoft.Contractions, I am using BasedOnStyles = Vale, Microsoft in my .ini file and the official untouched style files from https://github.com/errata-ai/Microsoft/releases/latest/download/Microsoft.zip.

It is all installed locally, the Microsoft.zip file is extracted into /home/david/bin/styles/Microsoft. Here is my full .ini file:

StylesPath = /home/david/bin/styles

Vocab = story

[*.md]
BasedOnStyles = Vale, Microsoft

When I say 'all sorts of nonsense' I mean you can type any spell error you want and it does not detect it. Yes, spell check is on using Vale in the .ini

ChrisChinchilla commented 3 years ago

@David-Else In your message above you mention the following error, that's what I am referring to…

On the following line, I get an error Use 'what's' instead of 'What is'.ValeMicrosoft.Contractions

for spelling errors, do you have an aspell/hunspell compatible dictionary installed? Using Linux, you probably do, but worth asking.

David-Else commented 3 years ago

OK, got it, to save you downloading the file it is:

extends: substitution
message: "Use '%s' instead of '%s'."
link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-contractions
level: error
ignorecase: true
action:
  name: replace
swap:
  are not: aren't
  cannot: can't
  could not: couldn't
  did not: didn't
  do not: don't
  does not: doesn't
  has not: hasn't
  have not: haven't
  how is: how's
  is not: isn't
  it is: it's
  should not: shouldn't
  that is: that's
  they are: they're
  was not: wasn't
  we are: we're
  we have: we've
  were not: weren't
  what is: what's
  when is: when's
  where is: where's
  will not: won't

I do have hunspell on the system. It is setup using this:

        # Allow ban.spellright to access built in hunspell directories
        sudo ln -s /usr/share/myspell "$HOME/.config/Code/Dictionaries

NOTE spellright is uninstalled now

David-Else commented 3 years ago

@ChrisChinchilla Did you manage to reproduce the bug, and do you need any more info? Cheers.

ChrisChinchilla commented 3 years ago

@David-Else Not yet! I have a day job :)