提交 280ea0b1 编写于 作者: R Ramya Achutha Rao

Fix infinite loop when node doesnt have non comment children. #27763

上级 9fa2a253
......@@ -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--) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册