Skip to content

Commit 9571a1f

Browse files
committed
[javascript mode] Recognize TypeScript tuple syntax
Closes #4918
1 parent 02050aa commit 9571a1f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mode/javascript/javascript.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
560560
}
561561
}
562562
if (type == "string" || type == "number" || type == "atom") return cont(afterType);
563+
if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
563564
if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
564565
if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType)
565566
}

0 commit comments

Comments
 (0)