You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I'm really glad to see the recent improvements to haxe-rename. I am now using the latest version of vshaxe 2.32.2 and it works much better that it did before for me. Thanks! 👍
However, I have noticed that there are some special cases where the renaming still does not work for me.
There's quite a lot of tink async handling in our project and there seems to be an issue with renaming usages inside callback functions (e.g. when resolving futures and promises).
I can reliably reproduce this in an example I have created:
To break it, just rename Printer.hx and observe that the first 2 example usages are renamed, but the other 2 are not.
The example is just one haxe module but this also fails when renaming across different modules. In this case the import is updated, but the usages still break.
Also attaching the code again just in case:
importjs.Browser;
importtink.core.Future;
importtink.core.Promise;
@:exposeclassMain {
publicstaticfunctionmain():Void {
// Setup stufffinalfutureTrigger=Future.trigger();
futureTrigger.trigger("Future");
finalpromise:Promise<String> =Promise.resolve("Promise");
// Example 1 - "Normal" usage of `Printer` (WORKS)newPrinterTestRename("Normal");
// Example 2 - `Printer` used within promise handling (WORKS)promise.handle(result-> {
switch (result) {
caseSuccess(text): newPrinterTestRename(text);
default:
}
});
// Example 3 - `Printer` used within future handling (FAILS)futureTrigger.asFuture().handle(text-> {
newPrinter(text);
});
// Example 4 - `Printer` used within promise handling but promise is created in `TextLoader` (FAILS)newTextLoader().load("TextLoader").handle(result-> {
switch (result) {
caseSuccess(text): newPrinter(text);
default:
}
});
}
}
// Rename this class and observe that examples 1 and 2 are updated, but the others are not.classPrinterTestRename {
publicfunctionnew(text:String) {
Browser.console.log(text);
}
}
classTextLoader {
publicfunctionnew() {}
publicfunctionload(text:String):Promise<String> {
returnPromise.resolve(text);
}
}
The text was updated successfully, but these errors were encountered:
Hello!
I'm really glad to see the recent improvements to haxe-rename. I am now using the latest version of vshaxe 2.32.2 and it works much better that it did before for me. Thanks! 👍
However, I have noticed that there are some special cases where the renaming still does not work for me.
There's quite a lot of tink async handling in our project and there seems to be an issue with renaming usages inside callback functions (e.g. when resolving futures and promises).
I can reliably reproduce this in an example I have created:
You can check it out here: https://try.haxe.org/#A590B9a5
If you want a project you can just clone, check this (
src/Main
): https://github.com/Tobbse/vshaxe_rename_testOr just check below for the code.
To break it, just rename
Printer.hx
and observe that the first 2 example usages are renamed, but the other 2 are not.The example is just one haxe module but this also fails when renaming across different modules. In this case the import is updated, but the usages still break.
Also attaching the code again just in case:
The text was updated successfully, but these errors were encountered: