Skip to content

Commit d0b40fb

Browse files
authored
Merge pull request #25750 from akyrtzi/5.1-disable-typo-correction
[5.1]Disable typo-correction by default until we can make it work within acceptable performance bounds
2 parents 42a3a19 + 39f6aae commit d0b40fb

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ namespace swift {
8989
bool DisableAvailabilityChecking = false;
9090

9191
/// Maximum number of typo corrections we are allowed to perform.
92-
unsigned TypoCorrectionLimit = 10;
92+
/// This is disabled by default until we can get typo-correction working within acceptable performance bounds.
93+
unsigned TypoCorrectionLimit = 0;
9394

9495
/// Should access control be respected?
9596
bool EnableAccessControl = true;

test/SourceKit/Sema/sema_symlink.swift.response

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,13 @@
1212
key.column: 16,
1313
key.filepath: real.swift,
1414
key.severity: source.diagnostic.severity.error,
15-
key.description: "use of unresolved identifier 'goo'; did you mean 'Bool'?",
15+
key.description: "use of unresolved identifier 'goo'",
1616
key.diagnostic_stage: source.diagnostic.stage.swift.sema,
1717
key.ranges: [
1818
{
1919
key.offset: 15,
2020
key.length: 3
2121
}
22-
],
23-
key.fixits: [
24-
{
25-
key.offset: 15,
26-
key.length: 3,
27-
key.sourcetext: "Bool"
28-
}
29-
],
30-
key.diagnostics: [
31-
{
32-
key.line: 1,
33-
key.column: 16,
34-
key.filepath: real.swift,
35-
key.severity: source.diagnostic.severity.note,
36-
key.description: "'Bool' declared here (Swift.Bool)"
37-
}
3822
]
3923
}
4024
]

test/lit.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,10 @@ else:
10701070
lit_config.fatal("Don't know how to define target_run and "
10711071
"target_build_swift for platform " + config.variant_triple)
10721072

1073+
# Enable typo-correction for testing purposes.
1074+
config.target_swift_frontend += " -typo-correction-limit 10 "
1075+
subst_target_swift_frontend_mock_sdk += " -typo-correction-limit 10 "
1076+
10731077
config.substitutions.append(('%module-target-triple',
10741078
target_specific_module_triple))
10751079

0 commit comments

Comments
 (0)