From 873bdcc57511a6d54c824880efc065e41b2f1d63 Mon Sep 17 00:00:00 2001 From: Jacob Wallraff Date: Wed, 14 Dec 2022 16:05:58 -0800 Subject: [PATCH] Uncomment context traversal --- .../src/context-providers/job.ts | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/actions-languageservice/src/context-providers/job.ts b/actions-languageservice/src/context-providers/job.ts index 3353be8..4a246c2 100644 --- a/actions-languageservice/src/context-providers/job.ts +++ b/actions-languageservice/src/context-providers/job.ts @@ -20,32 +20,32 @@ export function getJobContext(workflowContext: WorkflowContext): data.Dictionary if (!jobContext.get(key)) { switch (key) { case "container": - // var containerDictionary = new data.Dictionary(); - // for (const containerKey of containerKeys) { - // if (job.container[containerKey]) { - // containerDictionary.add(containerKey, job.container[containerKey]); - // } - // } - // jobContext.add(key, containerDictionary); - jobContext.add(key, new data.Null()); + var containerDictionary = new data.Dictionary(); + for (const containerKey of containerKeys) { + if (job.container[containerKey]) { + containerDictionary.add(containerKey, job.container[containerKey]); + } + } + jobContext.add(key, containerDictionary); + // jobContext.add(key, new data.Null()); break; case "services": - // var services = new data.Dictionary(); - // for (const service of job.services) { - // var serviceDictionary = new data.Dictionary(); - // for (const serviceKey of serviceKeys) { - // if (service[serviceKey]) { - // serviceDictionary.add(serviceKey, service[serviceKey]); - // } - // } - // services.add(service, serviceDictionary); - // } - // jobContext.add(key, services); - jobContext.add(key, new data.Null()); + var services = new data.Dictionary(); + for (const service of job.services) { + var serviceDictionary = new data.Dictionary(); + for (const serviceKey of serviceKeys) { + if (service[serviceKey]) { + serviceDictionary.add(serviceKey, service[serviceKey]); + } + } + services.add(service, serviceDictionary); + } + jobContext.add(key, services); + // jobContext.add(key, new data.Null()); break; case "status": - // jobContext.add(key, job.status); - jobContext.add(key, new data.Null()); + jobContext.add(key, job.status); + // jobContext.add(key, new data.Null()); break; } }