17
17
//// }
18
18
//// /*classThatHasAlreadyImplementedAnotherClassMethodAfterMethod*/
19
19
//// }
20
+ ////class D1 extends B {
21
+ //// /*classThatHasDifferentMethodThanBase*/
22
+ //// getValue1() {
23
+ //// return 10;
24
+ //// }
25
+ //// /*classThatHasDifferentMethodThanBaseAfterMethod*/
26
+ //// }
27
+ ////class D2 extends B {
28
+ //// /*classThatHasAlreadyImplementedAnotherClassProtectedMethod*/
29
+ //// protectedMethod() {
30
+ //// }
31
+ //// /*classThatHasDifferentMethodThanBaseAfterProtectedMethod*/
32
+ //// }
20
33
////class E {
21
34
//// /*classThatDoesNotExtendAnotherClass*/
22
35
//// }
@@ -131,6 +144,8 @@ function filterCompletionInfo(fn: (a: CompletionInfo) => boolean): CompletionInf
131
144
132
145
const instanceMemberInfo = filterCompletionInfo ( ( [ a ] : CompletionInfo ) => a === "getValue" || a === "protectedMethod" ) ;
133
146
const staticMemberInfo = filterCompletionInfo ( ( [ a ] : CompletionInfo ) => a === "staticMethod" ) ;
147
+ const instanceWithoutProtectedMemberInfo = filterCompletionInfo ( ( [ a ] : CompletionInfo ) => a === "getValue" ) ;
148
+ const instanceWithoutPublicMemberInfo = filterCompletionInfo ( ( [ a ] : CompletionInfo ) => a === "protectedMethod" ) ;
134
149
135
150
// Not a class element declaration location
136
151
const nonClassElementMarkers = [
@@ -156,8 +171,8 @@ verifyClassElementLocations({ validMembers: [], invalidMembers: allMembersOfBase
156
171
// Instance base members and class member keywords allowed
157
172
const classInstanceElementLocations = [
158
173
"classThatIsEmptyAndExtendingAnotherClass" ,
159
- "classThatHasAlreadyImplementedAnotherClassMethod " ,
160
- "classThatHasAlreadyImplementedAnotherClassMethodAfterMethod " ,
174
+ "classThatHasDifferentMethodThanBase " ,
175
+ "classThatHasDifferentMethodThanBaseAfterMethod " ,
161
176
"classThatHasWrittenPublicKeyword" ,
162
177
"classThatStartedWritingIdentifier" ,
163
178
"propDeclarationWithoutSemicolon" ,
@@ -183,4 +198,16 @@ const staticClassLocations = [
183
198
"classElementContainingStatic" ,
184
199
"classThatStartedWritingIdentifierAfterStaticModifier"
185
200
] ;
186
- verifyClassElementLocations ( staticMemberInfo , staticClassLocations ) ;
201
+ verifyClassElementLocations ( staticMemberInfo , staticClassLocations ) ;
202
+
203
+ const classInstanceElementWithoutPublicMethodLocations = [
204
+ "classThatHasAlreadyImplementedAnotherClassMethod" ,
205
+ "classThatHasAlreadyImplementedAnotherClassMethodAfterMethod" ,
206
+ ] ;
207
+ verifyClassElementLocations ( instanceWithoutPublicMemberInfo , classInstanceElementWithoutPublicMethodLocations ) ;
208
+
209
+ const classInstanceElementWithoutProtectedMethodLocations = [
210
+ "classThatHasAlreadyImplementedAnotherClassProtectedMethod" ,
211
+ "classThatHasDifferentMethodThanBaseAfterProtectedMethod" ,
212
+ ] ;
213
+ verifyClassElementLocations ( instanceWithoutProtectedMemberInfo , classInstanceElementWithoutProtectedMethodLocations ) ;
0 commit comments