sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
807 stars 39 forks source link

API for spell checking #2539

Open bordaigorl opened 5 years ago

bordaigorl commented 5 years ago

Problem description

There is currently no API to control/interact with the spell checker. It is impossible, for example, to obtain a list of suggested changes, obtain a list of the spelling errors, apply a suggestion. Possible use cases:

Preferred solution

An API exposing the basic spellchecker functions.

Ideally:

Optionally, spell checking functionality could be provided independently of views, i.e. sublime.spellchecker() returns an instance of Spellchecker with API like Spellchecker.config(dict), Spellchecker.check(text) etc..

Thom1729 commented 5 years ago

Maybe I'm wrong, but doesn't Sublime just use the system's spellcheck?

bordaigorl commented 5 years ago

From the docs:

Sublime Text uses Hunspell for its spell checking support.

That's the only official statement on this I could find...

Also from the same docs:

Commands

  • next_misspelling: Select the next misspelling
  • prev_misspelling: Select the previous misspelling
  • add_word: Adds the word given by the word argument to the add list
  • ignore_word: Adds the word given by the word argument to the ignore list

which offers a rather limited interface.

timfjord commented 3 years ago

Was about to request the same thing. It would be really good to have something like that in place as currently there is no way to pick a spell check suggestion rather than using a mouse/trackpad which is very inconvenient