From e45e416148ca17bca6da2f242a75e3c9d865a145 Mon Sep 17 00:00:00 2001 From: ninabreznik Date: Fri, 15 Dec 2017 01:04:22 +0700 Subject: [PATCH] Loop through VariableDeclaration in ParameterList --- src/app/editor/contextualListener.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/app/editor/contextualListener.js b/src/app/editor/contextualListener.js index 7f1c8f7ea2..ff1bae6f00 100644 --- a/src/app/editor/contextualListener.js +++ b/src/app/editor/contextualListener.js @@ -172,6 +172,7 @@ class ContextualListener { } _getInputParams (node) { + var params var list = [] for (var i in node.children) { if (node.children[i].name === 'ParameterList') { @@ -179,9 +180,19 @@ class ContextualListener { break } } + debugger for (var j in list) { - var params = list[j].children.length ? list[j].children[0].attributes.type : '' - break + if (list[j].children.length) { + var children = list[j].children + for (var k in children) { + if (children[k].name === 'VariableDeclaration') { + params = children[k].attributes.type + break + } + } + } else { + params = '' + } } return '(' + params + ')' }