Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b8d39d7

Browse filesBrowse files
authored
Merge pull request microsoft#16174 from Microsoft/max-10-errors-for-suggestions
Stop spelling suggestions after 10 name-not-found errors
2 parents 3eda9c6 + a72b14f commit b8d39d7
Copy full SHA for b8d39d7

6 files changed

+59-59Lines changed: 59 additions & 59 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/checker.ts‎

Copy file name to clipboardExpand all lines: src/compiler/checker.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,13 +1095,13 @@ namespace ts {
10951095
if (suggestedNameNotFoundMessage && suggestionCount < maximumSuggestionCount) {
10961096
suggestion = getSuggestionForNonexistentSymbol(originalLocation, name, meaning);
10971097
if (suggestion) {
1098-
suggestionCount++;
10991098
error(errorLocation, suggestedNameNotFoundMessage, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg), suggestion);
11001099
}
11011100
}
11021101
if (!suggestion) {
11031102
error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg));
11041103
}
1104+
suggestionCount++;
11051105
}
11061106
}
11071107
return undefined;
Collapse file

‎tests/baselines/reference/parserRealSource11.errors.txt‎

Copy file name to clipboardExpand all lines: tests/baselines/reference/parserRealSource11.errors.txt
+20-20Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(199,42): error
4646
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(219,33): error TS2304: Cannot find name 'NodeType'.
4747
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(231,30): error TS2304: Cannot find name 'Emitter'.
4848
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(231,48): error TS2304: Cannot find name 'TokenID'.
49-
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(233,52): error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
49+
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(233,52): error TS2304: Cannot find name 'TokenID'.
5050
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(237,36): error TS2304: Cannot find name 'TypeFlow'.
5151
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(251,21): error TS2304: Cannot find name 'Symbol'.
5252
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(268,19): error TS2304: Cannot find name 'NodeType'.
@@ -85,27 +85,27 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(427,22): error
8585
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(441,30): error TS2304: Cannot find name 'Emitter'.
8686
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(441,48): error TS2304: Cannot find name 'TokenID'.
8787
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(445,22): error TS2304: Cannot find name 'NodeType'.
88-
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(446,58): error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
88+
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(446,58): error TS2304: Cannot find name 'TokenID'.
8989
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(449,22): error TS2304: Cannot find name 'NodeType'.
90-
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(451,58): error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
90+
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(451,58): error TS2304: Cannot find name 'TokenID'.
9191
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(453,22): error TS2304: Cannot find name 'NodeType'.
92-
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(454,58): error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
92+
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(454,58): error TS2304: Cannot find name 'TokenID'.
9393
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(457,22): error TS2304: Cannot find name 'NodeType'.
9494
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(460,22): error TS2304: Cannot find name 'NodeType'.
9595
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(463,22): error TS2304: Cannot find name 'NodeType'.
96-
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(465,58): error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
96+
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(465,58): error TS2304: Cannot find name 'TokenID'.
9797
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(467,22): error TS2304: Cannot find name 'NodeType'.
9898
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(469,50): error TS2304: Cannot find name 'NodeType'.
99-
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(472,58): error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
99+
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(472,58): error TS2304: Cannot find name 'TokenID'.
100100
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(474,22): error TS2304: Cannot find name 'NodeType'.
101101
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(476,50): error TS2304: Cannot find name 'NodeType'.
102-
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(479,58): error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
102+
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(479,58): error TS2304: Cannot find name 'TokenID'.
103103
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(481,22): error TS2304: Cannot find name 'NodeType'.
104-
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(483,58): error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
104+
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(483,58): error TS2304: Cannot find name 'TokenID'.
105105
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(485,22): error TS2304: Cannot find name 'NodeType'.
106-
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(487,58): error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
106+
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(487,58): error TS2304: Cannot find name 'TokenID'.
107107
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(489,22): error TS2304: Cannot find name 'NodeType'.
108-
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(491,58): error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
108+
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(491,58): error TS2304: Cannot find name 'TokenID'.
109109
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(494,22): error TS2304: Cannot find name 'NodeType'.
110110
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(496,58): error TS2304: Cannot find name 'TokenID'.
111111
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(498,22): error TS2304: Cannot find name 'NodeType'.
@@ -848,7 +848,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
848848
emitter.recordSourceMappingStart(this);
849849
emitter.emitJavascriptList(this, null, TokenID.Semicolon, startLine, false, false);
850850
~~~~~~~
851-
!!! error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
851+
!!! error TS2304: Cannot find name 'TokenID'.
852852
emitter.recordSourceMappingEnd(this);
853853
}
854854

@@ -1139,7 +1139,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
11391139
!!! error TS2304: Cannot find name 'NodeType'.
11401140
emitter.emitJavascript(this.operand, TokenID.PlusPlus, false);
11411141
~~~~~~~
1142-
!!! error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
1142+
!!! error TS2304: Cannot find name 'TokenID'.
11431143
emitter.writeToOutput("++");
11441144
break;
11451145
case NodeType.LogNot:
@@ -1148,14 +1148,14 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
11481148
emitter.writeToOutput("!");
11491149
emitter.emitJavascript(this.operand, TokenID.Exclamation, false);
11501150
~~~~~~~
1151-
!!! error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
1151+
!!! error TS2304: Cannot find name 'TokenID'.
11521152
break;
11531153
case NodeType.DecPost:
11541154
~~~~~~~~
11551155
!!! error TS2304: Cannot find name 'NodeType'.
11561156
emitter.emitJavascript(this.operand, TokenID.MinusMinus, false);
11571157
~~~~~~~
1158-
!!! error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
1158+
!!! error TS2304: Cannot find name 'TokenID'.
11591159
emitter.writeToOutput("--");
11601160
break;
11611161
case NodeType.ObjectLit:
@@ -1174,7 +1174,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
11741174
emitter.writeToOutput("~");
11751175
emitter.emitJavascript(this.operand, TokenID.Tilde, false);
11761176
~~~~~~~
1177-
!!! error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
1177+
!!! error TS2304: Cannot find name 'TokenID'.
11781178
break;
11791179
case NodeType.Neg:
11801180
~~~~~~~~
@@ -1187,7 +1187,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
11871187
}
11881188
emitter.emitJavascript(this.operand, TokenID.Minus, false);
11891189
~~~~~~~
1190-
!!! error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
1190+
!!! error TS2304: Cannot find name 'TokenID'.
11911191
break;
11921192
case NodeType.Pos:
11931193
~~~~~~~~
@@ -1200,31 +1200,31 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
12001200
}
12011201
emitter.emitJavascript(this.operand, TokenID.Plus, false);
12021202
~~~~~~~
1203-
!!! error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
1203+
!!! error TS2304: Cannot find name 'TokenID'.
12041204
break;
12051205
case NodeType.IncPre:
12061206
~~~~~~~~
12071207
!!! error TS2304: Cannot find name 'NodeType'.
12081208
emitter.writeToOutput("++");
12091209
emitter.emitJavascript(this.operand, TokenID.PlusPlus, false);
12101210
~~~~~~~
1211-
!!! error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
1211+
!!! error TS2304: Cannot find name 'TokenID'.
12121212
break;
12131213
case NodeType.DecPre:
12141214
~~~~~~~~
12151215
!!! error TS2304: Cannot find name 'NodeType'.
12161216
emitter.writeToOutput("--");
12171217
emitter.emitJavascript(this.operand, TokenID.MinusMinus, false);
12181218
~~~~~~~
1219-
!!! error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
1219+
!!! error TS2304: Cannot find name 'TokenID'.
12201220
break;
12211221
case NodeType.Throw:
12221222
~~~~~~~~
12231223
!!! error TS2304: Cannot find name 'NodeType'.
12241224
emitter.writeToOutput("throw ");
12251225
emitter.emitJavascript(this.operand, TokenID.Tilde, false);
12261226
~~~~~~~
1227-
!!! error TS2552: Cannot find name 'TokenID'. Did you mean 'tokenId'?
1227+
!!! error TS2304: Cannot find name 'TokenID'.
12281228
emitter.writeToOutput(";");
12291229
break;
12301230
case NodeType.Typeof:
Collapse file

‎tests/baselines/reference/parserRealSource13.errors.txt‎

Copy file name to clipboardExpand all lines: tests/baselines/reference/parserRealSource13.errors.txt
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource13.ts(123,26): error
113113
tests/cases/conformance/parser/ecmascript5/parserRealSource13.ts(123,39): error TS2304: Cannot find name 'AST'.
114114
tests/cases/conformance/parser/ecmascript5/parserRealSource13.ts(128,33): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'.
115115
tests/cases/conformance/parser/ecmascript5/parserRealSource13.ts(132,51): error TS2304: Cannot find name 'AST'.
116-
tests/cases/conformance/parser/ecmascript5/parserRealSource13.ts(135,36): error TS2552: Cannot find name 'NodeType'. Did you mean 'nodeType'?
116+
tests/cases/conformance/parser/ecmascript5/parserRealSource13.ts(135,36): error TS2304: Cannot find name 'NodeType'.
117117

118118

119119
==== tests/cases/conformance/parser/ecmascript5/parserRealSource13.ts (116 errors) ====
@@ -483,7 +483,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource13.ts(135,36): error
483483
var nodeType = ast.nodeType;
484484
var callbackString = (<any>NodeType)._map[nodeType] + "Callback";
485485
~~~~~~~~
486-
!!! error TS2552: Cannot find name 'NodeType'. Did you mean 'nodeType'?
486+
!!! error TS2304: Cannot find name 'NodeType'.
487487
if (callback[callbackString]) {
488488
return callback[callbackString](pre, ast);
489489
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.