Skip to content

[5.1]Disable typo-correction by default until we can make it work within acceptable performance bounds #25750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/swift/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ namespace swift {
bool DisableAvailabilityChecking = false;

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

/// Should access control be respected?
bool EnableAccessControl = true;
Expand Down
18 changes: 1 addition & 17 deletions test/SourceKit/Sema/sema_symlink.swift.response
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,13 @@
key.column: 16,
key.filepath: real.swift,
key.severity: source.diagnostic.severity.error,
key.description: "use of unresolved identifier 'goo'; did you mean 'Bool'?",
key.description: "use of unresolved identifier 'goo'",
key.diagnostic_stage: source.diagnostic.stage.swift.sema,
key.ranges: [
{
key.offset: 15,
key.length: 3
}
],
key.fixits: [
{
key.offset: 15,
key.length: 3,
key.sourcetext: "Bool"
}
],
key.diagnostics: [
{
key.line: 1,
key.column: 16,
key.filepath: real.swift,
key.severity: source.diagnostic.severity.note,
key.description: "'Bool' declared here (Swift.Bool)"
}
]
}
]
4 changes: 4 additions & 0 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,10 @@ else:
lit_config.fatal("Don't know how to define target_run and "
"target_build_swift for platform " + config.variant_triple)

# Enable typo-correction for testing purposes.
config.target_swift_frontend += " -typo-correction-limit 10 "
subst_target_swift_frontend_mock_sdk += " -typo-correction-limit 10 "

config.substitutions.append(('%module-target-triple',
target_specific_module_triple))

Expand Down