Skip to content

Commit 4877343

Browse files
committed
Reduce max number of spelling suggestions to 10
1 parent ee1edf0 commit 4877343

13 files changed

+323
-781
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ namespace ts {
319319
const resolutionPropertyNames: TypeSystemPropertyName[] = [];
320320

321321
let suggestionCount = 0;
322-
const maximumSuggestionCount = 100;
322+
const maximumSuggestionCount = 10;
323323
const mergedSymbols: Symbol[] = [];
324324
const symbolLinks: SymbolLinks[] = [];
325325
const nodeLinks: NodeLinks[] = [];

tests/baselines/reference/maximum100SpellingSuggestions.errors.txt

Lines changed: 0 additions & 378 deletions
This file was deleted.

tests/baselines/reference/maximum100SpellingSuggestions.js

Lines changed: 0 additions & 140 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
tests/cases/compiler/maximum10SpellingSuggestions.ts(4,1): error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
2+
tests/cases/compiler/maximum10SpellingSuggestions.ts(4,6): error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
3+
tests/cases/compiler/maximum10SpellingSuggestions.ts(4,11): error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
4+
tests/cases/compiler/maximum10SpellingSuggestions.ts(4,16): error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
5+
tests/cases/compiler/maximum10SpellingSuggestions.ts(4,21): error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
6+
tests/cases/compiler/maximum10SpellingSuggestions.ts(4,26): error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
7+
tests/cases/compiler/maximum10SpellingSuggestions.ts(4,31): error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
8+
tests/cases/compiler/maximum10SpellingSuggestions.ts(4,36): error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
9+
tests/cases/compiler/maximum10SpellingSuggestions.ts(4,41): error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
10+
tests/cases/compiler/maximum10SpellingSuggestions.ts(4,46): error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
11+
tests/cases/compiler/maximum10SpellingSuggestions.ts(5,1): error TS2304: Cannot find name 'bob'.
12+
tests/cases/compiler/maximum10SpellingSuggestions.ts(5,6): error TS2304: Cannot find name 'bob'.
13+
14+
15+
==== tests/cases/compiler/maximum10SpellingSuggestions.ts (12 errors) ====
16+
// 10 bobs on the first line
17+
// the last two bobs should not have did-you-mean spelling suggestions
18+
var blob;
19+
bob; bob; bob; bob; bob; bob; bob; bob; bob; bob;
20+
~~~
21+
!!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
22+
~~~
23+
!!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
24+
~~~
25+
!!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
26+
~~~
27+
!!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
28+
~~~
29+
!!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
30+
~~~
31+
!!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
32+
~~~
33+
!!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
34+
~~~
35+
!!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
36+
~~~
37+
!!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
38+
~~~
39+
!!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'?
40+
bob; bob;
41+
~~~
42+
!!! error TS2304: Cannot find name 'bob'.
43+
~~~
44+
!!! error TS2304: Cannot find name 'bob'.
45+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//// [maximum10SpellingSuggestions.ts]
2+
// 10 bobs on the first line
3+
// the last two bobs should not have did-you-mean spelling suggestions
4+
var blob;
5+
bob; bob; bob; bob; bob; bob; bob; bob; bob; bob;
6+
bob; bob;
7+
8+
9+
//// [maximum10SpellingSuggestions.js]
10+
// 10 bobs on the first line
11+
// the last two bobs should not have did-you-mean spelling suggestions
12+
var blob;
13+
bob;
14+
bob;
15+
bob;
16+
bob;
17+
bob;
18+
bob;
19+
bob;
20+
bob;
21+
bob;
22+
bob;
23+
bob;
24+
bob;

0 commit comments

Comments
 (0)