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

Commit 48f5dd2

Browse files
soda0289JamesHenry
authored andcommitted
Breaking: Include type annotation range for Identifiers (fixes #314)
1 parent 074a64f commit 48f5dd2

File tree

3 files changed

+4939
-66
lines changed

3 files changed

+4939
-66
lines changed

lib/convert.js

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

536536
if (node.type) {
537537
result.id.typeAnnotation = convertTypeAnnotation(node.type);
538+
result.id.range[1] = node.type.getEnd();
538539
}
539540
break;
540541

@@ -1145,9 +1146,8 @@ module.exports = function convert(config) {
11451146
}
11461147

11471148
if (node.type) {
1148-
Object.assign(parameter, {
1149-
typeAnnotation: convertTypeAnnotation(node.type)
1150-
});
1149+
parameter.typeAnnotation = convertTypeAnnotation(node.type);
1150+
parameter.range[1] = node.type.getEnd();
11511151
}
11521152

11531153
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)