Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit 4e1547d

Browse files
committed
Breaking: Include type annotation range for Identifiers (fixes #314)
1 parent b26cda1 commit 4e1547d

File tree

3 files changed

+176
-67
lines changed

3 files changed

+176
-67
lines changed

lib/convert.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ module.exports = function convert(config) {
527527

528528
if (node.type) {
529529
result.id.typeAnnotation = convertTypeAnnotation(node.type);
530+
result.id.range[1] = node.type.getEnd();
530531
}
531532
break;
532533

@@ -1127,9 +1128,8 @@ module.exports = function convert(config) {
11271128
}
11281129

11291130
if (node.type) {
1130-
Object.assign(parameter, {
1131-
typeAnnotation: convertTypeAnnotation(node.type)
1132-
});
1131+
parameter.typeAnnotation = convertTypeAnnotation(node.type);
1132+
parameter.range[1] = node.type.getEnd();
11331133
}
11341134

11351135
if (node.questionToken) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
var name:string = "Nicholas";
2+
var foo: string = "Bar";

0 commit comments

Comments
 (0)