intellij-haxe
intellij-haxe copied to clipboard
Colourizing issue
Yet another colourizing issue. Here are the screenshots and the code:

package ;
import String;
class Orchestrator {
var proj:SongInstance;
public function addVariant(v:VariantBuf) {
allVariants.push(v);
}
public var allVariants(default, null):Array<VariantBuf> = [];
function nm(v:String) {
return v.split(' ').join('');
}
public function new(proj:SongInstance) {
this.proj = proj;
entireMap = new Map();
}
function ensureMap(subject:String, chunkN:Int) {
if (!entireMap.exists(subject)) entireMap.set(subject, new Map());
var sMap = entireMap[subject];
if (!sMap.exists(chunkN)) sMap.set(chunkN, new Map());
return sMap[chunkN];
}
/**
* should be called by variant once it's ready with the chunk on a subject
**/
public function iAmReady(subject:String, variantName:String, chunkN:Int) {
var map = ensureMap(subject, chunkN);
map[variantName] = true;
// trace('<---"${subject}" ~$chunkN : ${nm(variantName)} loaded, so: ${Lambda.count(map)}/${allVariants.length}');
}
/**
* should be called by variant to check if other variants are ready with this chunk on the subject
**/
public function isEveryoneReady(subject:String, variantName:String, chunkN:Int) {
var map = ensureMap(subject, chunkN);
var yes = Lambda.count(map) >= allVariants.length;
// trace('===> ~$chunkN : ${nm(variantName)} asks if ready: ${Lambda.count(map)} >= ${allVariants.length} = ${yes}');
return yes;
}
public function waitUntilEveryoneIsReady(subject:String, variantName:String, chunkN:Int, whenReady:Void -> Void) {
function go() {
if (!isEveryoneReady(subject, variantName, chunkN))
Util.delay(go, 5);
else whenReady();
}
go();
}
var entireMap:MapKeyChunkVarBool;
}
typedef MapOfVariantNameAndBool = Map<String, Bool>;
typedef MapChunkVarBool = Map<Int, MapOfVariantNameAndBool>;
typedef MapKeyChunkVarBool = Map<String, MapChunkVarBool>;
Thanks for the report!
Just thinking about this... The keywords are still colorized, so the parser didn't get confused. I'll bet the semantic annotator got stuck in a loop and the annotator got canceled.
I'm just guessing here: The naked new Map() (without the expected type parameters) might be triggering the infinite lookup error in HaxeClassResolveResult.getSpecificClassReference().
@Shalmu the issue should now be resolved in the latest beta build, can you verify that it works on your system. https://github.com/HaxeFoundation/intellij-haxe/releases/tag/pre-release%2F202102271815
looks solved so closing this one