Skip to content

Commit

Permalink
fix: Fix failing ts 2.4 test for IndexSignatureDeclaration.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Feb 9, 2018
1 parent c7bec28 commit 654e5c2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/compiler/base/JSDocableNode.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as ts from "typescript";
import {Constructor} from "./../../Constructor";
import {insertIntoParent, verifyAndGetIndex, getEndIndexFromArray} from "./../../manipulation";
import {insertIntoParentTextRange, verifyAndGetIndex, getEndIndexFromArray} from "./../../manipulation";
import {JSDocStructure, JSDocableNodeStructure} from "./../../structures";
import {JSDocStructureToText} from "./../../structureToTexts";
import {callBaseFill} from "./../callBaseFill";
Expand Down Expand Up @@ -72,12 +72,10 @@ export function JSDocableNode<T extends Constructor<JSDocableNodeExtensionType>>
index = verifyAndGetIndex(index, nodes.length);

const insertPos = index === nodes.length ? this.getStart() : nodes[index].getStart();
insertIntoParent({
insertIntoParentTextRange({
insertPos,
parent: this,
newText: code,
childIndex: nodes.length > 0 ? nodes[0].getChildIndex() + index : 0,
insertItemsCount: structures.length
newText: code
});

return this.getJsDocs().slice(index, index + structures.length);
Expand Down

0 comments on commit 654e5c2

Please sign in to comment.