From 280ea0b10cd96d3a965ef408104722ef8d353c10 Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Wed, 28 Jun 2017 16:02:46 -0700 Subject: [PATCH] Fix infinite loop when node doesnt have non comment children. #27763 --- extensions/emmet/src/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/emmet/src/util.ts b/extensions/emmet/src/util.ts index a62c42ce432..846313e3c01 100644 --- a/extensions/emmet/src/util.ts +++ b/extensions/emmet/src/util.ts @@ -116,7 +116,7 @@ export function getOpenCloseRange(document: vscode.TextDocument, position: vscod } export function getDeepestNode(node: Node): Node { - if (!node || !node.children || node.children.length === 0) { + if (!node || !node.children || node.children.length === 0 || !node.children.find(x => x.type !== 'comment')) { return node; } for (let i = node.children.length - 1; i >= 0; i--) { -- GitLab