Skip to content

Commit 7fd19f3

Browse files
authored
Merge pull request swiftlang#25674 from akyrtzi/disable-typo-correction
Disable typo-correction by default until we can make it work within acceptable performance bounds
2 parents b2ce4a2 + cf65b8f commit 7fd19f3

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
@@ -88,7 +88,8 @@ namespace swift {
8888
bool DisableAvailabilityChecking = false;
8989

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

9394
/// Should access control be respected?
9495
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
@@ -1175,6 +1175,10 @@ else:
11751175
lit_config.fatal("Don't know how to define target_run and "
11761176
"target_build_swift for platform " + config.variant_triple)
11771177

1178+
# Enable typo-correction for testing purposes.
1179+
config.target_swift_frontend += " -typo-correction-limit 10 "
1180+
subst_target_swift_frontend_mock_sdk += " -typo-correction-limit 10 "
1181+
11781182
config.substitutions.append(('%module-target-triple',
11791183
target_specific_module_triple))
11801184

0 commit comments

Comments
 (0)