From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Wed, 19 Feb 2025 11:18:44 -0800 Subject: fix: re-enable synchronous spellcheck on Windows This fix partially reverts 6109477: Code Health: Clean up stale base::Feature "WinRetrieveSuggestionsOnlyOnDemand" https://chromium-review.googlesource.com/c/chromium/src/+/6109477 by re-adding a synchronous call to FillSuggestionList. This patch can be removed when an asynchronous spellcheck API option is added to Electron. diff --git a/components/spellcheck/browser/windows_spell_checker.cc b/components/spellcheck/browser/windows_spell_checker.cc index f5a7411037758427eddc088b5426554b4a500d33..04b3edd4d8c58d38e260cc54beb0dab86368fc25 100644 --- a/components/spellcheck/browser/windows_spell_checker.cc +++ b/components/spellcheck/browser/windows_spell_checker.cc @@ -239,6 +239,11 @@ std::vector BackgroundHelper::RequestTextCheckForAllLanguages( (action == CORRECTIVE_ACTION_GET_SUGGESTIONS || action == CORRECTIVE_ACTION_REPLACE)) { std::vector suggestions; + // TODO (vertedinde): Perform the synchronous operation of retrieving + // suggestions for all misspelled words while performing a text check. + FillSuggestionList(it->first, + text.substr(start_index, error_length), + &suggestions); result_map[std::tuple(start_index, error_length)] .push_back(suggestions); }