Build cache works better with compiler server.
This commit is contained in:
@@ -5,6 +5,7 @@ import haxe.macro.Expr;
|
|||||||
import haxe.macro.Type;
|
import haxe.macro.Type;
|
||||||
import tink.macro.TypeMap;
|
import tink.macro.TypeMap;
|
||||||
|
|
||||||
|
using tink.MacroApi;
|
||||||
using haxe.macro.Tools;
|
using haxe.macro.Tools;
|
||||||
|
|
||||||
typedef BuildContextN = {
|
typedef BuildContextN = {
|
||||||
@@ -104,7 +105,7 @@ class BuildCache {
|
|||||||
usings: ctx.usings
|
usings: ctx.usings
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function getType(name, ?type, ?pos:Position, build:BuildContext->TypeDefinition) {
|
static public function getType(name, ?type, ?pos:Position, build:BuildContext->TypeDefinition) {
|
||||||
|
|
||||||
if (pos == null)
|
if (pos == null)
|
||||||
@@ -156,18 +157,29 @@ private class Group {
|
|||||||
usings: usings,
|
usings: usings,
|
||||||
name: path.split('.').pop()
|
name: path.split('.').pop()
|
||||||
});
|
});
|
||||||
|
|
||||||
Context.defineModule(path, [def], usings);
|
|
||||||
entries.set(type, { name: path } );
|
entries.set(type, { name: path } );
|
||||||
|
Context.defineModule(path, [def], usings);
|
||||||
return Context.getType(path);
|
return Context.getType(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doMake()
|
||||||
|
while (true)
|
||||||
|
switch '$name${counter++}' {
|
||||||
|
case _.definedType() => Some(_):
|
||||||
|
case v:
|
||||||
|
return make(v);
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
switch entries.get(type) {
|
switch entries.get(type) {
|
||||||
case null:
|
case null:
|
||||||
make('$name${counter++}');
|
doMake();
|
||||||
case v:
|
case v:
|
||||||
Context.getType(v.name);
|
switch v.name.definedType() {
|
||||||
|
case Some(v): v;
|
||||||
|
default: doMake();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user