Closed dmoonfire closed 4 years ago
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 https://github.com/atom/atom/issues/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).
Works as expected with all combinations of check boxes except only locales. Note that each screenshot is after a Window: Reload
No checkboxes, no spelling errors (I believe this is the expected result)
Note that Aussi
(French for Also) is spelled correctly here:
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 atom/spell-check
to get it working since I don't have access to Windows or Mac machines. They were all running green, but I haven't seen this error before: https://github.visualstudio.com/Atom/_build/results?buildId=59300&view=logs&j=0da5d1d9-276d-5173-c4c4-9d4d4ed14fdb&t=b525c197-f769-5e52-d38a-e6301f5260f2&l=1396
Cannot replace with lazy function because the supplied node does not belong to an assignment expression or a variable declaration!
I don't normally build Atom from source, just the plugins. This error looks like it is pointing to the require.resolve
which is based on the plugin system which I wrote earlier. Is there a chance there is a new rule or process that is transforming the file that would choke on the dynamic requires?
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 resolve
call.
So far, I'm not entirely sure what the problem is to fix it. I'll try to look into it.
@calebmeyer Did you manage to get spell-check working on a non en-US
language on Windows? I can't seem to make it work, even though the dictionaries are there..
same issue here as @ashthespy
Requirements
While investigating https://github.com/atom/atom/issues/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 https://github.com/atom/node-spellchecker/pull/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