Skip to content

Commit 3f010a6

Browse files
author
Deep Furiya
committed
rev-2 addressed comments
1 parent 531d577 commit 3f010a6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/autocomplete/ResourceSectionCompletionProvider.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ export class ResourceSectionCompletionProvider implements CompletionProvider {
9090
}
9191

9292
private isAtResourceTypeField(context: Context): boolean {
93-
if (context.propertyPath[context.propertyPath.length - 1] !== 'Type') {
94-
return false;
95-
}
96-
const startIndex = context.getEntityType() === EntityType.ForEachResource ? 4 : 2;
97-
const propertiesIndex = context.propertyPath.indexOf('Properties', startIndex);
98-
return propertiesIndex === -1;
93+
const propertyPathLength = context.getEntityType() === EntityType.ForEachResource ? 5 : 3;
94+
95+
return (
96+
context.propertyPath.length === propertyPathLength &&
97+
context.propertyPath[context.propertyPath.length - 1] === 'Type'
98+
);
9999
}
100100
}
101101

0 commit comments

Comments
 (0)