Sublime-JS-Custom icon indicating copy to clipboard operation
Sublime-JS-Custom copied to clipboard

flow_types breaks highlighting after ternary and bitshift

Open mischnic opened this issue 3 years ago • 2 comments

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

Bildschirmfoto 2021-11-21 um 13 30 02

mischnic avatar Nov 21 '21 12:11 mischnic

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.

Thom1729 avatar Nov 21 '21 14:11 Thom1729

This should be fixed in 4.3.0-beta.2.

Thom1729 avatar Mar 06 '22 16:03 Thom1729