fix_win32_synchronous_spellcheck.patch 1.5 KB

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