mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-18 13:59:04 -05:00
Only 100 spelling corrections for unknown symbols
If your compilation has more than 100 unknown symbols, the problem is missing declarations, not typos.
This commit is contained in:
@@ -318,6 +318,8 @@ namespace ts {
|
||||
const resolutionResults: boolean[] = [];
|
||||
const resolutionPropertyNames: TypeSystemPropertyName[] = [];
|
||||
|
||||
let suggestionCount = 0;
|
||||
const maximumSuggestionCount = 100;
|
||||
const mergedSymbols: Symbol[] = [];
|
||||
const symbolLinks: SymbolLinks[] = [];
|
||||
const nodeLinks: NodeLinks[] = [];
|
||||
@@ -1091,9 +1093,10 @@ namespace ts {
|
||||
!checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) &&
|
||||
!checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning)) {
|
||||
let suggestion: string | undefined;
|
||||
if (suggestedNameNotFoundMessage) {
|
||||
if (suggestedNameNotFoundMessage && suggestionCount < maximumSuggestionCount) {
|
||||
suggestion = getSuggestionForNonexistentSymbol(originalLocation, name, meaning);
|
||||
if (suggestion) {
|
||||
suggestionCount++;
|
||||
error(errorLocation, suggestedNameNotFoundMessage, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg), suggestion);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user