bartosz-antosik / vscode-spellright

Multilingual, Offline and Lightweight Spellchecker for Visual Studio Code
Other
360 stars 37 forks source link

Weird behavior #23

Closed athosmoreno closed 7 years ago

athosmoreno commented 7 years ago

I installed this extension on my Visual Studio Code and I couldn't figure it out how it works or if it is working properly on my computer.

The spell check didn't worked ever on new plain text files. I tried with LaTeX files (with syntax plugins) and it only works if I reselect the language that I want to correct (I already set it by default on settings.json).

Any help would be appreciated. I'm using Windows 10 Home Single Language with Creators Update.

bartosz-antosik commented 7 years ago

Could you please help me and answer the questions below:

  1. What have you set in in settings as the language?
  2. If you switch it using the list (I mean using GUI, like you describe if I understand it correctly) then it spells correctly until it is restarted?
  3. If you would switch it using the list (like in 2) and then select SpellRight: Create/Update Workspace Settings and then restart would it spell correctly?
  4. After 3. what would be the value of language in spellright.json workspace file in .vscode directory?
athosmoreno commented 7 years ago
  1. I set "Portuguese". I tried "pt_BR" (since there is two kinds of portuguese) but it didn't worked.
  2. It makes the corrections immediatly when I reselect the language when using LaTeX files. It has no effect on plain text
bartosz-antosik commented 7 years ago

If you could please try 3 (Selet Ctrl+Shift+P and then select SpellRight: Create/Update Workspace Settings) and after that see what is written to workspace settings (4).

Ad. 1. I would rather try pt or pt-BR with Windows native spell checking API, but doing 3 + 4 will tell us what is the name of the dictionary you have. Then it would be easier to us to proceed with some sort of refinement/resolution for your situation.

bartosz-antosik commented 7 years ago

Also, please, if you could have a look at the DEBUG output if there is any debug output at the moment e.g. when you switch to PlainText document (which is as you say not spelled at all).

athosmoreno commented 7 years ago

Doing 3. created this:

{ "language": "Portuguese", "documentTypes": [ "markdown", "latex", "plaintext" ], "groupDictionaries": true, "statusBarIndicator": true, "suggestionsInHints": true, "ignoreWords": [], "ignoreRegExps": [], "ignoreFiles": [ "**/.gitignore", "**/.spellignore" ] }

It also made no effect. I had to reselect the language to make it work.

I made a GIF to explain it better:

2017-07-01_18-38-38

athosmoreno commented 7 years ago

I setted pt-BR on settings.json and it seemed to work on everywhere now.

bartosz-antosik commented 7 years ago

Please give version 1.0.23 a try. It should fix what you observe. Should also set default language to Portuguese without need to set it anywhere in settings.

athosmoreno commented 7 years ago

It seemed to work. However I had to remove pt-BR from settings to work.

Is there anyway to choose between Portuguese and English?

bartosz-antosik commented 7 years ago

Generally the extension integrates all dictionaries with one region (e.g. en-UK, en-US, en-CA etc.) into one entry in the list ("English") and selects the dictionary by setting e.g. "en" in settings. So in your case "pt" would be sufficient to select Portuguese. It's done to avoid mess of having e.g. 15 English dictionaries for exotic regions. This will be maybe changed in the future or made optional etc.

Does the status bar switch display English on the list of available dictionaries? Then it is enough to select it from the list or put "en" in whichever settings (User or Workspace) to make the change permanent.

If English dictionary is not displayed you have to add it to Windows spelled languages (somewhere in Control Panel if I remember correctly and nothing changed recently with progress of Microsoft moving things to Settings).

athosmoreno commented 7 years ago

I mean if it there is a way to use English as a dictionary. When I click in the eye icon it only shows Portuguese and Spanish (don't know why, since my computer doesn't have anything in spanish)

bartosz-antosik commented 7 years ago

To spell in English you have to have english spelling installed in Windows. I have no idea whether "Windows Single Language" is any different but normally you have to add languages in Control Panel's Language section as you can see below:

langugage

Why do you have Spanish language in the list I cannot tell, but the extension is supposed only to list dictionaries returned by the Windows Spelling API - so it looks, somehow, like it has returned Spanish dictionary.

athosmoreno commented 7 years ago

the whole point of "Single Language" is that... Windows only supports one language. so no english spelling for me until I update my Windows version 😢

since my only language and dictionary is Portuguese (Brazil) it shouldn't have Spanish dictionary. but thats a minor detail I guess. you can close the issue now since it was fixed

bartosz-antosik commented 7 years ago

I have not closed this since I had to check this thoroughly but it seems you are absolutely right - Windows Single Language does not allow to install more than one language pack.

There is another option for you: You can set system variable (there where you set PATH) named "SPELLCHECKER_PREFER_HUNSPELL" to 1 and the extension will use Hunspell spellchecker in Windows 10. Then you have to install dictionaries as described in the README.md under the Note on Windows 7 Installation heading. This procedure will allow you to have as many languages/dictionaries as you wish. Please remember that the variable you set in spellright.language is the name of the dictionary (also see recently updated README.md for more on this).

bartosz-antosik commented 7 years ago

Once again: I was wrong! My initial intuition & searches in the web (the reason I was not closing the issue for so long) were correct.

Single Language Windows edition does not allow one thing: Change of display language. It does however install other spelling dictionaries & work with them correctly. Here see Windows Single Language EN/US spelling in Polish:

windows-single-language-1

Here is Control Panel with two languages installed:

windows-single-language-2

And here is the information that what you cannot change is Display Language:

windows-single-language-3

P.S. Please let me know if this messages get to you!

athosmoreno commented 7 years ago

Gonna try here. I tried to install from the "new" Settings thing on Windows 10 so perhaps thats why didn't worked.

athosmoreno commented 7 years ago

witchcraft, it works!

image

bartosz-antosik commented 7 years ago

Great! Thanks for cooperation.