Skip to content

Commit 9bf5209

Browse files
committed
Lower allowed length difference for suggestions
And update baselines
1 parent 4877343 commit 9bf5209

6 files changed

+17
-17
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14205,7 +14205,7 @@ namespace ts {
1420514205
*/
1420614206
function getSpellingSuggestionForName(name: string, symbols: Symbol[], meaning: SymbolFlags): Symbol | undefined {
1420714207
const worstDistance = name.length * 0.4;
14208-
const maximumLengthDifference = Math.min(4, name.length * 0.34);
14208+
const maximumLengthDifference = Math.min(3, name.length * 0.34);
1420914209
let bestDistance = Number.MAX_VALUE;
1421014210
let bestCandidate = undefined;
1421114211
if (name.length > 30) {

tests/baselines/reference/innerModExport2.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ tests/cases/compiler/innerModExport2.ts(5,5): error TS2304: Cannot find name 'mo
22
tests/cases/compiler/innerModExport2.ts(5,12): error TS1005: ';' expected.
33
tests/cases/compiler/innerModExport2.ts(7,20): error TS2395: Individual declarations in merged declaration 'export_var' must be all exported or all local.
44
tests/cases/compiler/innerModExport2.ts(13,9): error TS2395: Individual declarations in merged declaration 'export_var' must be all exported or all local.
5-
tests/cases/compiler/innerModExport2.ts(20,7): error TS2551: Property 'NonExportFunc' does not exist on type 'typeof Outer'. Did you mean 'ExportFunc'?
5+
tests/cases/compiler/innerModExport2.ts(20,7): error TS2339: Property 'NonExportFunc' does not exist on type 'typeof Outer'.
66

77

88
==== tests/cases/compiler/innerModExport2.ts (5 errors) ====
@@ -35,4 +35,4 @@ tests/cases/compiler/innerModExport2.ts(20,7): error TS2551: Property 'NonExport
3535

3636
Outer.NonExportFunc();
3737
~~~~~~~~~~~~~
38-
!!! error TS2551: Property 'NonExportFunc' does not exist on type 'typeof Outer'. Did you mean 'ExportFunc'?
38+
!!! error TS2339: Property 'NonExportFunc' does not exist on type 'typeof Outer'.

tests/baselines/reference/parser15.4.4.14-9-2.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(16,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
22
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'false'.
3-
tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error TS2552: Cannot find name 'runTestCase'. Did you mean 'testcase'?
3+
tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error TS2304: Cannot find name 'runTestCase'.
44

55

66
==== tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts (2 errors) ====
@@ -33,5 +33,5 @@ tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error T
3333
}
3434
runTestCase(testcase);
3535
~~~~~~~~~~~
36-
!!! error TS2552: Cannot find name 'runTestCase'. Did you mean 'testcase'?
36+
!!! error TS2304: Cannot find name 'runTestCase'.
3737

tests/baselines/reference/parserRealSource7.errors.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(206,48): error T
7171
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(206,66): error TS2304: Cannot find name 'DualStringHashTable'.
7272
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(206,90): error TS2304: Cannot find name 'StringHashTable'.
7373
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(206,113): error TS2304: Cannot find name 'StringHashTable'.
74-
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(207,31): error TS2552: Cannot find name 'ModuleType'. Did you mean 'modType'?
74+
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(207,31): error TS2304: Cannot find name 'ModuleType'.
7575
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(209,42): error TS2304: Cannot find name 'TypeFlags'.
7676
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(211,39): error TS2304: Cannot find name 'ScopedMembers'.
7777
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(211,57): error TS2304: Cannot find name 'DualStringHashTable'.
@@ -100,7 +100,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(250,82): error T
100100
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(251,38): error TS2304: Cannot find name 'ScopedMembers'.
101101
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(251,56): error TS2304: Cannot find name 'DualStringHashTable'.
102102
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(251,107): error TS2304: Cannot find name 'StringHashTable'.
103-
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(253,27): error TS2552: Cannot find name 'ModuleType'. Did you mean 'modType'?
103+
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(253,27): error TS2304: Cannot find name 'ModuleType'.
104104
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(255,38): error TS2304: Cannot find name 'TypeFlags'.
105105
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(272,33): error TS2304: Cannot find name 'SymbolFlags'.
106106
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(276,33): error TS2304: Cannot find name 'SymbolFlags'.
@@ -196,7 +196,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(476,57): error T
196196
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(477,29): error TS2304: Cannot find name 'ValueLocation'.
197197
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(478,29): error TS2304: Cannot find name 'hasFlag'.
198198
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(478,55): error TS2304: Cannot find name 'VarFlags'.
199-
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(480,21): error TS2304: Cannot find name 'FieldSymbol'.
199+
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(480,21): error TS2552: Cannot find name 'FieldSymbol'. Did you mean 'fieldSymbol'?
200200
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(482,34): error TS2304: Cannot find name 'hasFlag'.
201201
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(482,60): error TS2304: Cannot find name 'VarFlags'.
202202
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(492,30): error TS2304: Cannot find name 'getTypeLink'.
@@ -218,7 +218,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(507,26): error T
218218
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(507,52): error TS2304: Cannot find name 'ASTFlags'.
219219
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(518,22): error TS2304: Cannot find name 'FieldSymbol'.
220220
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(531,29): error TS2304: Cannot find name 'ValueLocation'.
221-
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(533,21): error TS2304: Cannot find name 'FieldSymbol'.
221+
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(533,21): error TS2552: Cannot find name 'FieldSymbol'. Did you mean 'fieldSymbol'?
222222
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(535,53): error TS2304: Cannot find name 'VarFlags'.
223223
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(535,75): error TS2304: Cannot find name 'VarFlags'.
224224
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(539,38): error TS2304: Cannot find name 'SymbolFlags'.
@@ -658,7 +658,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(828,13): error T
658658
!!! error TS2304: Cannot find name 'StringHashTable'.
659659
modType = new ModuleType(enclosedTypes, ambientEnclosedTypes);
660660
~~~~~~~~~~
661-
!!! error TS2552: Cannot find name 'ModuleType'. Did you mean 'modType'?
661+
!!! error TS2304: Cannot find name 'ModuleType'.
662662
if (isEnum) {
663663
modType.typeFlags |= TypeFlags.IsEnum;
664664
~~~~~~~~~
@@ -762,7 +762,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(828,13): error T
762762

763763
modType = new ModuleType(enclosedTypes, ambientEnclosedTypes);
764764
~~~~~~~~~~
765-
!!! error TS2552: Cannot find name 'ModuleType'. Did you mean 'modType'?
765+
!!! error TS2304: Cannot find name 'ModuleType'.
766766
if (isEnum) {
767767
modType.typeFlags |= TypeFlags.IsEnum;
768768
~~~~~~~~~
@@ -1181,7 +1181,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(828,13): error T
11811181
var fieldSymbol =
11821182
new FieldSymbol(argDecl.id.text, argDecl.minChar,
11831183
~~~~~~~~~~~
1184-
!!! error TS2304: Cannot find name 'FieldSymbol'.
1184+
!!! error TS2552: Cannot find name 'FieldSymbol'. Did you mean 'fieldSymbol'?
11851185
context.checker.locationInfo.unitIndex,
11861186
!hasFlag(argDecl.varFlags, VarFlags.Readonly),
11871187
~~~~~~~
@@ -1278,7 +1278,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(828,13): error T
12781278
var fieldSymbol =
12791279
new FieldSymbol(varDecl.id.text, varDecl.minChar,
12801280
~~~~~~~~~~~
1281-
!!! error TS2304: Cannot find name 'FieldSymbol'.
1281+
!!! error TS2552: Cannot find name 'FieldSymbol'. Did you mean 'fieldSymbol'?
12821282
context.checker.locationInfo.unitIndex,
12831283
(varDecl.varFlags & VarFlags.Readonly) == VarFlags.None,
12841284
~~~~~~~~
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity1.ts(2,2): error TS2552: Cannot find name 'notregexp'. Did you mean 'RegExp'?
1+
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity1.ts(2,2): error TS2304: Cannot find name 'notregexp'.
22
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity1.ts(2,12): error TS2304: Cannot find name 'a'.
33

44

55
==== tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity1.ts (2 errors) ====
66
1
77
/notregexp/a.foo();
88
~~~~~~~~~
9-
!!! error TS2552: Cannot find name 'notregexp'. Did you mean 'RegExp'?
9+
!!! error TS2304: Cannot find name 'notregexp'.
1010
~
1111
!!! error TS2304: Cannot find name 'a'.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity2.ts(1,6): error TS2552: Cannot find name 'notregexp'. Did you mean 'RegExp'?
1+
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity2.ts(1,6): error TS2304: Cannot find name 'notregexp'.
22
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity2.ts(1,16): error TS2304: Cannot find name 'a'.
33

44

55
==== tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity2.ts (2 errors) ====
66
(1) /notregexp/a.foo();
77
~~~~~~~~~
8-
!!! error TS2552: Cannot find name 'notregexp'. Did you mean 'RegExp'?
8+
!!! error TS2304: Cannot find name 'notregexp'.
99
~
1010
!!! error TS2304: Cannot find name 'a'.

0 commit comments

Comments
 (0)