File tree Expand file tree Collapse file tree 2 files changed +52
-9
lines changed
Expand file tree Collapse file tree 2 files changed +52
-9
lines changed Original file line number Diff line number Diff line change @@ -29277,9 +29277,10 @@ m2: ${(this.mapper2 as unknown as DebugTypeMapper).__debugToString().split("\n")
2927729277 if (file) {
2927829278 if (compilerOptions.checkJs === undefined && file.checkJsDirective === undefined && (file.scriptKind === ScriptKind.JS || file.scriptKind === ScriptKind.JSX)) {
2927929279 const declarationFile = forEach(suggestion?.declarations, getSourceFileOfNode);
29280+ const suggestionHasNoExtends = !suggestion?.valueDeclaration || !isClassLike(suggestion.valueDeclaration) || suggestion.valueDeclaration.heritageClauses?.length
2928029281 return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile))
29281- && !(excludeClasses && suggestion && suggestion.flags & SymbolFlags.Class)
29282- && !(!!node && excludeClasses && isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword);
29282+ && !(excludeClasses && suggestion && suggestion.flags & SymbolFlags.Class && suggestionHasNoExtends )
29283+ && !(!!node && excludeClasses && isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword && suggestionHasNoExtends );
2928329284 }
2928429285 }
2928529286 return false;
Original file line number Diff line number Diff line change 11/// <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+ verify . codeFixAll ( {
27+ fixId : "fixSpelling" ,
28+ fixAllDescription : "Fix all detected spelling errors" ,
29+ newFileContent :
30+ `class C {
31+ numble = 1
32+ mumble() {
33+ return this.numble
34+ }
35+ }
36+ class D extends C { }
37+ const c = new C()
38+ c.numble = 3
39+ c.mumble()
40+ const d = new D()
41+ d.numbles = 4
42+ d.mumbles()
43+ class Person {
44+ getFavoriteColor() {
245
3- // @allowjs : true
4- // @noEmit : true
46+ }
47+ }
548
6- // @filename : noSuggestionWithoutDidYouMean.js
7- //// let a = {};
8- //// console.log(a.apple);
9- verify . noErrors ( )
10- verify . getSuggestionDiagnostics ( [ ] )
49+ const person = new Person();
50+ person.getFavoriteColor();
51+ person.getFavoriteColor();` ,
52+ } ) ;
You can’t perform that action at this time.
0 commit comments