HaxeCheckstyle / haxe-rename

A code renaming tool for Haxe
MIT License
17 stars 1 forks source link

Failing to rename local symbol #4

Closed dubspeed closed 1 month ago

dubspeed commented 3 months ago

👋 Hello,

in the example below, TESTRENAME will only be renamed in 2 of 3 cases.

(full example project here)

package src;

class DemoClassA {
    public var someValue:String;
}

class SomeOtherClass {
    public function isEventFeatureFlag(aString:String):Bool {
        return false;
    }

    public function new() {}
}

class WontRename {
    var TESTRENAME:Bool = false;

    var _view:{
        isAssetsLoaded:Bool
    };
    var _someOtherClass:SomeOtherClass = new SomeOtherClass();

    function _onFeatureEnds(event:DemoClassA) {
        // misses a rename in the next line
        if (_view.isAssetsLoaded && _someOtherClass.isEventFeatureFlag(event.someValue) && TESTRENAME) {
            TESTRENAME = false;
        }
    }
}