diff --git a/actions-languageservice/src/complete.ts b/actions-languageservice/src/complete.ts index 5ecf738..bce981a 100644 --- a/actions-languageservice/src/complete.ts +++ b/actions-languageservice/src/complete.ts @@ -167,8 +167,7 @@ export function getExistingValues(token: TemplateToken | null, parent: TemplateT if (isSequence(parent)) { const sequenceValues = new Set(); - for (let i = 0; i < parent.count; i++) { - const t = parent.get(i); + for (const t of parent) { if (isString(t)) { // Should we support other literal values here? sequenceValues.add(t.value); @@ -184,9 +183,7 @@ export function getExistingValues(token: TemplateToken | null, parent: TemplateT const mapKeys = new Set(); const mapToken = parent as MappingToken; - for (let i = 0; i < mapToken.count; i++) { - const key = mapToken.get(i).key; - + for (const {key} of mapToken) { if (isString(key)) { mapKeys.add(key.value); } diff --git a/actions-languageservice/src/context-providers/matrix.ts b/actions-languageservice/src/context-providers/matrix.ts index a306929..99b37b9 100644 --- a/actions-languageservice/src/context-providers/matrix.ts +++ b/actions-languageservice/src/context-providers/matrix.ts @@ -99,8 +99,7 @@ function matrixProperties(matrix: MappingToken, mode: Mode): Map(); - for (let j = 0; j < pair.value.count; j++) { - const value = pair.value.get(j); + for (const value of pair.value) { // The parser should coerce matrix values to strings, ignore expressions if (isString(value)) { values.add(value.value); @@ -143,14 +141,12 @@ function matrixProperties(matrix: MappingToken, mode: Mode): Map