You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1) ClassLikeDeclarationBase
addConstructor
class with empty comments:
Manipulation error: Error replacing tree: Should not have children left over.
-- Details --
Path: /testFile.ts
Text: "class c {\n //\n\n constructor() {\n }\n //\n}"
Stack: Error: Error replacing tree: Should not have children left over.
at RangeParentHandler.handleNode (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/RangeParentHandler.ts:71:19)
at ParentFinderReplacementNodeHandler.handleNode (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/ParentFinderReplacementNodeHandler.ts:25:36)
at NodeHandlerHelper.handleForValues (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/NodeHandlerHelper.ts:14:21)
at ParentFinderReplacementNodeHandler.handleChildren (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/StraightReplacementNodeHandler.ts:43:25)
at ParentFinderReplacementNodeHandler.handleNode (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/StraightReplacementNodeHandler.ts:27:18)
at ParentFinderReplacementNodeHandler.handleNode (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/ParentFinderReplacementNodeHandler.ts:28:19)
at NodeHandlerHelper.handleForValues (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/NodeHandlerHelper.ts:14:21)
at ParentFinderReplacementNodeHandler.handleChildren (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/StraightReplacementNodeHandler.ts:43:25)
at ParentFinderReplacementNodeHandler.handleNode (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/StraightReplacementNodeHandler.ts:27:18)
at ParentFinderReplacementNodeHandler.handleNode (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/ParentFinderReplacementNodeHandler.ts:28:19)
at Object.doManipulation (/Users/paranoidjk/github/ts-morph/src/manipulation/manipulations/doManipulation.ts:18:21)
at insertIntoBracesOrSourceFile (/Users/paranoidjk/github/ts-morph/src/manipulation/manipulations/insertion.ts:260:5)
at Object.insertIntoBracesOrSourceFileWithGetChildren (/Users/paranoidjk/github/ts-morph/src/manipulation/manipulations/insertion.ts:313:5)
at insertChildren (/Users/paranoidjk/github/ts-morph/src/compiler/ast/class/base/ClassLikeDeclarationBase.ts:1165:12)
at ClassDeclaration.insertConstructors (/Users/paranoidjk/github/ts-morph/src/compiler/ast/class/base/ClassLikeDeclarationBase.ts:670:20)
at ClassDeclaration.insertConstructor (/Users/paranoidjk/github/ts-morph/src/compiler/ast/class/base/ClassLikeDeclarationBase.ts:664:25)
at ClassDeclaration.addConstructor (/Users/paranoidjk/github/ts-morph/src/compiler/ast/class/base/ClassLikeDeclarationBase.ts:656:25)
at doTest (/Users/paranoidjk/github/ts-morph/src/tests/compiler/ast/class/base/classLikeDeclarationBaseTests.ts:303:39)
at Context.it (/Users/paranoidjk/github/ts-morph/src/tests/compiler/ast/class/base/classLikeDeclarationBaseTests.ts:313:13)
at callFn (/Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runnable.js:387:21)
at Test.Runnable.run (/Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runnable.js:379:7)
at Runner.runTest (/Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runner.js:535:10)
at /Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runner.js:653:12
at next (/Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runner.js:447:14)
at /Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runner.js:457:7
at next (/Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runner.js:362:14)
at Immediate._onImmediate (/Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runner.js:425:5)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
Error: Manipulation error: Error replacing tree: Should not have children left over.
Describe the bug
Version: "3.6.4" (latest)
1) ClassLikeDeclarationBase addConstructor class with empty comments: Manipulation error: Error replacing tree: Should not have children left over. -- Details -- Path: /testFile.ts Text: "class c {\n //\n\n constructor() {\n }\n //\n}" Stack: Error: Error replacing tree: Should not have children left over. at RangeParentHandler.handleNode (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/RangeParentHandler.ts:71:19) at ParentFinderReplacementNodeHandler.handleNode (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/ParentFinderReplacementNodeHandler.ts:25:36) at NodeHandlerHelper.handleForValues (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/NodeHandlerHelper.ts:14:21) at ParentFinderReplacementNodeHandler.handleChildren (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/StraightReplacementNodeHandler.ts:43:25) at ParentFinderReplacementNodeHandler.handleNode (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/StraightReplacementNodeHandler.ts:27:18) at ParentFinderReplacementNodeHandler.handleNode (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/ParentFinderReplacementNodeHandler.ts:28:19) at NodeHandlerHelper.handleForValues (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/NodeHandlerHelper.ts:14:21) at ParentFinderReplacementNodeHandler.handleChildren (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/StraightReplacementNodeHandler.ts:43:25) at ParentFinderReplacementNodeHandler.handleNode (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/StraightReplacementNodeHandler.ts:27:18) at ParentFinderReplacementNodeHandler.handleNode (/Users/paranoidjk/github/ts-morph/src/manipulation/nodeHandlers/ParentFinderReplacementNodeHandler.ts:28:19) at Object.doManipulation (/Users/paranoidjk/github/ts-morph/src/manipulation/manipulations/doManipulation.ts:18:21) at insertIntoBracesOrSourceFile (/Users/paranoidjk/github/ts-morph/src/manipulation/manipulations/insertion.ts:260:5) at Object.insertIntoBracesOrSourceFileWithGetChildren (/Users/paranoidjk/github/ts-morph/src/manipulation/manipulations/insertion.ts:313:5) at insertChildren (/Users/paranoidjk/github/ts-morph/src/compiler/ast/class/base/ClassLikeDeclarationBase.ts:1165:12) at ClassDeclaration.insertConstructors (/Users/paranoidjk/github/ts-morph/src/compiler/ast/class/base/ClassLikeDeclarationBase.ts:670:20) at ClassDeclaration.insertConstructor (/Users/paranoidjk/github/ts-morph/src/compiler/ast/class/base/ClassLikeDeclarationBase.ts:664:25) at ClassDeclaration.addConstructor (/Users/paranoidjk/github/ts-morph/src/compiler/ast/class/base/ClassLikeDeclarationBase.ts:656:25) at doTest (/Users/paranoidjk/github/ts-morph/src/tests/compiler/ast/class/base/classLikeDeclarationBaseTests.ts:303:39) at Context.it (/Users/paranoidjk/github/ts-morph/src/tests/compiler/ast/class/base/classLikeDeclarationBaseTests.ts:313:13) at callFn (/Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runnable.js:387:21) at Test.Runnable.run (/Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runnable.js:379:7) at Runner.runTest (/Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runner.js:535:10) at /Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runner.js:653:12 at next (/Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runner.js:447:14) at /Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runner.js:457:7 at next (/Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runner.js:362:14) at Immediate._onImmediate (/Users/paranoidjk/github/ts-morph/node_modules/mocha/lib/runner.js:425:5) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5) Error: Manipulation error: Error replacing tree: Should not have children left over.
To Reproduce
Failed Test Case: paranoidjk@544ada6
Demo:
The text was updated successfully, but these errors were encountered: