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

Fix: Calculate end position of TypeInstantiation (fixes #406) #405

Merged
merged 2 commits into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ module.exports = function convert(config) {
const firstTypeArgument = typeArguments[0];
const typeArgumentsParent = firstTypeArgument.parent;
/**
* In the case of the parent being a CallExpression we have to use slightly different
* logic to calculate the correct end position
* In the case of the parent being a CallExpression or a TypeReference we have to use
* slightly different logic to calculate the correct end position
*/
if (typeArgumentsParent && typeArgumentsParent.kind === SyntaxKind.CallExpression) {
if (typeArgumentsParent && (typeArgumentsParent.kind === SyntaxKind.CallExpression || typeArgumentsParent.kind === SyntaxKind.TypeReference)) {
const lastTypeArgument = typeArguments[typeArguments.length - 1];
const greaterThanToken = nodeUtils.findNextToken(lastTypeArgument, ast);
end = greaterThanToken.end;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class AudioBufferList {
mBuffers: interop.Reference<any /*AudioBuffer*/>;
}
Loading