summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r--lib/Sema/SemaLookup.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index e95ffce054..d0bb9f6abe 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -3872,6 +3872,14 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName,
DeclContext *MemberContext,
bool EnteringContext,
const ObjCObjectPointerType *OPT) {
+ // Always let the ExternalSource have the first chance at correction, even
+ // if we would otherwise have given up.
+ if (ExternalSource) {
+ if (TypoCorrection Correction = ExternalSource->CorrectTypo(
+ TypoName, LookupKind, S, SS, CCC, MemberContext, EnteringContext, OPT))
+ return Correction;
+ }
+
if (Diags.hasFatalErrorOccurred() || !getLangOpts().SpellChecking)
return TypoCorrection();