NSSpellServerDelegate uses old API even when using the new one.

Originator:mlaskow3
Number:rdar://24710963 Date Originated:18-Feb-2016
Status:Open Resolved:
Product:OS X SDK Product Version:
Classification:UI/Usability Reproducible:Always
 
Summary:
If implemented `spellServer:checkString:offset:types:options:orthography:wordCount:` for NSSpellServerDelegate, the system should not call the other methods (`spellServer:findMisspelledWordInString:language:wordCount:countOnly:`, `spellServer:suggestGuessesForWord:inLanguage:`), but it does. Usually calls spellServer:suggestGuessesForWord:inLanguage: for guesses (even if you provided corrections in the new method). But for TextEdit it also calls spellServer:findMisspelledWordInString:language:wordCount:countOnly: when right-clicked on misspelled word.

If the older methods are not implemented, guesses will not work.

It was already mentioned in: https://lists.apple.com/archives/Cocoa-dev/2009/Oct/msg00637.html

Steps to Reproduce:
1. Create a simple custom spell server, using NSSpellServerDelegate.
2. Implement method  `spellServer:checkString:offset:types:options:orthography:wordCount:` 
3. Implement methods `spellServer:suggestGuessesForWord:inLanguage:` and `spellServer:findMisspelledWordInString:language:wordCount:countOnly:`
4. Run TextEdit, enter misspelled words, right click on them.
5. Observe `spellServer:suggestGuessesForWord:inLanguage:` and `spellServer:findMisspelledWordInString:language:wordCount:countOnly:`being called.

Expected Results:
`spellServer:suggestGuessesForWord:inLanguage:` and `spellServer:findMisspelledWordInString:language:wordCount:countOnly:` should not be called if `spellServer:checkString:offset:types:options:orthography:wordCount:` is implemented. 


Actual Results:
`spellServer:suggestGuessesForWord:inLanguage:` and `spellServer:findMisspelledWordInString:language:wordCount:countOnly:` are called. Not implementing these methods causes guesses for word to not work.

Version:
Xcode 7.2, Mac OS X 10.11.2

Notes:


Configuration:
OS X 10.11.2

Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!