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
FlxRandom.hx : int() (flixel/math/FlxRandom.hx) -> this one is more sophisticated example. The function is refered to as "FlxG.random.int()" in the code, the error message is: unable to determine type of "random" in /Users/michael/inno/flixel/flixel/animation/FlxAnimation.hx@4207 - however the type is pretty clearly set.
The text was updated successfully, but these errors were encountered:
Rename the function via "Rename symbol": observe only two of four items are renamed.
I tried to reproduce your sample with up-to-date flixel sources and when correctly set up with language server I get 5 rename places, one in FlxMatrix and all four in FlxFrame. if language server is not working properly, I only get 3.
the problem is that rename relies on language server type resolution to figure out if an identifier needs to be renamed or if it's just an identical name from an unrelated type. if language server is unavailable or doesn't answer, then rename lib has some limited ways of figuring out types on its own, but it can't compete with the type info that Haxe compiler has (or should have).
for larger projects language server is not always the fastest and people love to complain about it, yet it still is the only way to get reliable type info on all affected locations for any rename operation.
your FlxRandom.int sample e.g. takes a very long time to complete, mainly because it finds all instances of Std.int and resolves each and every one of them with Haxe compiler. in the end it comes up with a list that looks complete (I haven't really checked it).
I'm pretty sure there's some room for improvements and optimisations, e.g. resolving Std.int just once and caching the result for all places where Std doesn't reference a different thing.
for successful renames you want to make sure your "haxe.renameSourceFolder" is set up correctly, Haxe languageserver is up and running without throwing errors, your sources are saved prior to rename operation and you want to make sure that Hover requests are fast (use Haxe ServerView to watch your timings).
👋 Hello, when renaming public functions, some obvious occurrences are missed.
Example:
Note:
this might require to add the "flixel" folder to "haxe.renameSourceFolder" in some settings.json.
More examples in the same codebase:
The text was updated successfully, but these errors were encountered: