-
Notifications
You must be signed in to change notification settings - Fork 121
Split checkers to explictly handle macOS/Windows system checkers verses locale-based checking #314
Conversation
73bc077
to
a567376
Compare
- The locale version uses the locale paths but can be used without an environment variable. - This is the same logic for Linux and when the environment variable was used (which no longer is used). - Defaults to on. - The system version only uses the operating system based checker and always ignores Hunspell, even with the environment variable. - This does nothing on Linux but can be set. - Defaults to on. - Refactored tests to be easier to clean. - Added system-based checking tests but are only active on OS X because of inconsistent availability on Windows.
This splits checking into system and locale based ones as shown in the screenshot below. Due to my access to platforms, I'm going to need help with verifying this code on various forms of Windows and OS X, with single and different languages at the same time. Specific care needs to be looked at for atom/atom#15912 which causes a crash when using multiple languages (this is handled by having only a single "system" checker regardless of the number of views open). |
a567376
to
ffa893a
Compare
I can't get good screenshots for windows right now, but I ran the same checks. As you mentioned on slack, I'd need to install a custom dictionary for French. Windows version is Windows 10 Enterprise 1903 With both checked:
With just system:
With just locales:
With neither checked:
|
Thanks for this @dmoonfire! @lkashef is going to take a look 👍 |
Thanks @dmoonfire 🙇♂️ |
Hey @dmoonfire, did you try running the tests on Atom using your PR, because the build keeps failing on the CI. |
@lkashef. I had to use the pull checks on
I don't normally build Atom from source, just the plugins. This error looks like it is pointing to the https://blog.inkdrop.info/understanding-atom-editor-and-hacking-it-to-build-a-react-app-4692f049795 is where I got my information about it being the |
So far, I'm not entirely sure what the problem is to fix it. I'll try to look into it. |
No idea what atom/spell-check#314 did, but the package is now griping at startup about missing dictionaries, even though it's working fine (words like "colour" are recognised, and "color" is marked as a misspelling).
@calebmeyer Did you manage to get spell-check working on a non |
same issue here as @ashthespy |
Requirements
While investigating atom/atom#15912, the problem seemed to be based on calling the macOS built-in checking library with different locales. With multiple languages, that would call it with first one and then the second. Eventually, there would be an error thrown that caused the system to crash.
Then, while working on that item, we identified a problem where certain Windows 10 installations (in my case, an enterprise-distributed one) don't always provide spell-checking for non-English dictionaries and therefore couldn't use the built-in language for non-English (or whatever) languages.
In both of these cases, we need to be able to use system checker in a generic manner (without specifying language) or force the use of Hunspell even without the environment variable.
Description of the Change
So, to fix that, I got atom/node-spellchecker#115 merged that exposes an explicit flag to choose system or Hunspell-based checking while setting up the library.
Now, I need to change the UI to split built-in system checking verses locale which involves some UI changes and verification since now there are more options to control how spell-checking is done.
The three environments also have different rules:
Alternate Designs
Originally this was going to just be a macOS fix however the validation with Windows 10 that caused the problem identified a more generic problem.
I also considered splitting out the
spell-check
checkers out intospell-check-windows
,spell-check-macos
,spell-check-hunspell
but I didn't get a definitive opinion either way. This option is still possible, it would just require automatically packaging 1-3 of these with the normal Atom installation.Benefits
Possible Drawbacks
Applicable Issues