Sublime-JS-Custom
Sublime-JS-Custom copied to clipboard
flow_types breaks highlighting after ternary and bitshift
Sublime Text build number
4121
Example Code
const recordDefinition = (a) => {
return a ? (a) : (a << 5);
};
d[105] = (data)=>{
if (token >= 144 && token < 160 || token == 220 || token == 221) target = [];
else target = {};
};
d[115] = ()=>new Set(read());
const typedArrays = ['BigUint64'].map((type)=>type + 'Array');
JS Custom Preferences
{
"configurations": {
"Default": {}
},
"defaults": {
"file_extensions": ["js", "jsx"],
"flow_types": true,
"jsx": true
}
}
Configuration name
JS Custom - Default
Description
The second line breaks the highlighting for the rest of the file.
It works correctly with "flow_types": false
Minimal example:
return a ? (a) : (a < 5);
let x;
The bug is in Flow only, not in TypeScript, so there should hopefully be a simple fix.
This should be fixed in 4.3.0-beta.2.