File tree 2 files changed +77
-9
lines changed 2 files changed +77
-9
lines changed Original file line number Diff line number Diff line change @@ -32306,9 +32306,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
32306
32306
if (file) {
32307
32307
if (compilerOptions.checkJs === undefined && file.checkJsDirective === undefined && (file.scriptKind === ScriptKind.JS || file.scriptKind === ScriptKind.JSX)) {
32308
32308
const declarationFile = forEach(suggestion?.declarations, getSourceFileOfNode);
32309
+ const suggestionHasNoExtendsOrDecorators = !suggestion?.valueDeclaration
32310
+ || !isClassLike(suggestion.valueDeclaration)
32311
+ || suggestion.valueDeclaration.heritageClauses?.length
32312
+ || classOrConstructorParameterIsDecorated(/*useLegacyDecorators*/ false, suggestion.valueDeclaration);
32309
32313
return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile))
32310
- && !(excludeClasses && suggestion && suggestion.flags & SymbolFlags.Class)
32311
- && !(!!node && excludeClasses && isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword);
32314
+ && !(excludeClasses && suggestion && suggestion.flags & SymbolFlags.Class && suggestionHasNoExtendsOrDecorators )
32315
+ && !(!!node && excludeClasses && isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword && suggestionHasNoExtendsOrDecorators );
32312
32316
}
32313
32317
}
32314
32318
return false;
Original file line number Diff line number Diff line change 1
1
/// <reference path='fourslash.ts' />
2
+ // @allowJs : true
3
+ // @Filename : codeFixSpellingJs9.js
4
+ //// class C {
5
+ //// numble = 1
6
+ //// mumble() {
7
+ //// return this.[|numbles|]
8
+ //// }
9
+ //// }
10
+ //// class D extends C { }
11
+ //// const c = new C()
12
+ //// c.[|numbles|] = 3
13
+ //// c.[|mumbles|]()
14
+ //// const d = new D()
15
+ //// d.[|numbles|] = 4
16
+ //// d.[|mumbles()|]
17
+ //// class Person {
18
+ //// getFavoriteColor() {
19
+ ////
20
+ //// }
21
+ //// }
22
+ ////
23
+ //// const person = new Person();
24
+ //// person.[|getFavoriteColour|]();
25
+ //// person.[|getFavoriteColoxr|]();
26
+ //// function deco() { }
27
+ //// @deco
28
+ //// class Art {
29
+ //// style = true
30
+ //// }
31
+ //// const a = new Art()
32
+ //// a.[|stylo|]
33
+ //// @deco
34
+ //// class Double extends Art { }
35
+ //// const db = new Double()
36
+ //// db.[|stylo|]
37
+ verify . codeFixAll ( {
38
+ fixId : "fixSpelling" ,
39
+ fixAllDescription : "Fix all detected spelling errors" ,
40
+ newFileContent :
41
+ `class C {
42
+ numble = 1
43
+ mumble() {
44
+ return this.numble
45
+ }
46
+ }
47
+ class D extends C { }
48
+ const c = new C()
49
+ c.numble = 3
50
+ c.mumble()
51
+ const d = new D()
52
+ d.numbles = 4
53
+ d.mumbles()
54
+ class Person {
55
+ getFavoriteColor() {
2
56
3
- // @allowjs : true
4
- // @noEmit : true
57
+ }
58
+ }
5
59
6
- // @filename : noSuggestionWithoutDidYouMean.js
7
- //// let a = {};
8
- //// console.log(a.apple);
9
- verify . noErrors ( )
10
- verify . getSuggestionDiagnostics ( [ ] )
60
+ const person = new Person();
61
+ person.getFavoriteColor();
62
+ person.getFavoriteColor();
63
+ function deco() { }
64
+ @deco
65
+ class Art {
66
+ style = true
67
+ }
68
+ const a = new Art()
69
+ a.stylo
70
+ @deco
71
+ class Double extends Art { }
72
+ const db = new Double()
73
+ db.stylo` ,
74
+ } ) ;
You can’t perform that action at this time.
0 commit comments