mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-04 15:25:47 +01:00
Fix infinite loop when node doesnt have non comment children. #27763
This commit is contained in:
@@ -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--) {
|
||||
|
||||
Reference in New Issue
Block a user