Skip to content
Snippets Groups Projects
Commit 897bb77e authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[javascript mode] Recognize TS bool literal types and type names with dots

Closes #4437
parent c2a11a31
No related branches found
No related tags found
No related merge requests found
......@@ -539,7 +539,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}
function typeexpr(type) {
if (type == "variable") {cx.marked = "variable-3"; return cont(afterType);}
if (type == "string" || type == "number") return cont(afterType);
if (type == "string" || type == "number" || type == "atom") return cont(afterType);
if (type == "{") return cont(commasep(typeprop, "}"))
if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType)
}
......@@ -560,7 +560,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}
function afterType(type, value) {
if (value == "<") return cont(commasep(typeexpr, ">"), afterType)
if (value == "|") return cont(typeexpr)
if (value == "|" || type == ".") return cont(typeexpr)
if (type == "[") return cont(expect("]"), afterType)
}
function vardef() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment