fix: re-enable synchronous spellcheck on Windows (#45712)
* fix: re-enable synchronous spellcheck on Windows * revert: fix: empty suggestions with windows platform checker --------- Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
This commit is contained in:
parent
8d58999135
commit
6248c2436a
6 changed files with 35 additions and 63 deletions
29
patches/chromium/fix_win32_synchronous_spellcheck.patch
Normal file
29
patches/chromium/fix_win32_synchronous_spellcheck.patch
Normal file
|
@ -0,0 +1,29 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Keeley Hammond <khammond@slack-corp.com>
|
||||
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<SpellCheckResult> BackgroundHelper::RequestTextCheckForAllLanguages(
|
||||
(action == CORRECTIVE_ACTION_GET_SUGGESTIONS ||
|
||||
action == CORRECTIVE_ACTION_REPLACE)) {
|
||||
std::vector<std::u16string> 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<ULONG, ULONG>(start_index, error_length)]
|
||||
.push_back(suggestions);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue