You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose spellcheck_platform::CheckSpelling API #22829
Hi, thank you for creating such a great framework!
I have a feature request which I think I can contribute, but let me check if you are interested in supporting it.
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
The builtin spellchecker has been supported in #20692.
But it does not allow us to check spells programmatically, like node-spellchecker's isMisspelled method.
Chrome's spellcheck_platform provides CheckSpelling to do that exactly.
Proposed Solution
Add a method to call spellcheck_platform::CheckSpelling like so:
My usecase is that I'm building a Markdown editor based on CodeMirror which browser's spellchecker doesn't work.
So, we have to use a plugin like codemirror-spell-checker which checks spellings in JS.
I found SpellCheck::SpellCheckWord which looks cross platform.
Would it be possible to invoke from Session?
I have the same setup with CodeMirror. After digging around for a few hours, I did not find any undocumented spellcheck access 😂
The current alternative is to use typo.js and self-manage hunspell libraries downloading from the renderer. Other than having to do all that repeated work, it also doesn't support multiple languages (cfinke/Typo.js#37)
A second alternative is to bring in electron-spellchecker (or a variant of it) which is what we were trying to move away from in the first place with native spellchecker support.
Hoping we can make this a reality. Thanks again for all the hard work!
@MarshallOfSound I've put down a few hours into exploring the codebase and hooking up a working prototype. Currently having some trouble with how to properly expose the API. Would really appreciate if you have some tips.
Activity
MarshallOfSound commentedon Mar 25, 2020
@craftzdog That method is not cross platform, can you clarify your usecase for this method?
craftzdog commentedon Mar 26, 2020
@MarshallOfSound Thanks for the reply.
My usecase is that I'm building a Markdown editor based on CodeMirror which browser's spellchecker doesn't work.
So, we have to use a plugin like codemirror-spell-checker which checks spellings in JS.
I found
SpellCheck::SpellCheckWordwhich looks cross platform.Would it be possible to invoke from
Session?astoilkov commentedon Apr 25, 2020
@MarshallOfSound On what operating system is the
spellcheck_platform::CheckSpellingavailable? What aboutSpellCheck::SpellCheckWord?Exposing the API will benefit a lot of applications using a custom editor. The electron site shows 65 applications that contain "editor" in their description.
We have the same problem at https://caret.io/.
lishid commentedon May 30, 2020
I have the same setup with CodeMirror. After digging around for a few hours, I did not find any undocumented spellcheck access 😂
The current alternative is to use typo.js and self-manage hunspell libraries downloading from the renderer. Other than having to do all that repeated work, it also doesn't support multiple languages (cfinke/Typo.js#37)
A second alternative is to bring in electron-spellchecker (or a variant of it) which is what we were trying to move away from in the first place with native spellchecker support.
Hoping we can make this a reality. Thanks again for all the hard work!
abnerlee commentedon Jun 5, 2020
Maybe also expose
spellcheck_platform::FillSuggestionListto get suggestions for words that are "misspelled"lishid commentedon Aug 20, 2020
@MarshallOfSound I've put down a few hours into exploring the codebase and hooking up a working prototype. Currently having some trouble with how to properly expose the API. Would really appreciate if you have some tips.
As for use case, adding to the others here, I'm working on https://obsidian.md which is also based on CodeMirror.
@craftzdog @astoilkov @abnerlee Also wanted to say hi, big fan of all your work! 😃
craftzdog commentedon Aug 21, 2020
@lishid hi 👋 Great to know you made a PR for the issue!