Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables is not resolved when name non-case-sensetively matches Type #405

Closed
eliasku opened this issue Feb 6, 2016 · 6 comments
Closed

Comments

@eliasku
Copy link
Contributor

eliasku commented Feb 6, 2016

If name of variable match Type-name is non-case-sensetive mode - resolving is broken.
If name is different - all works fine.
To reproduce - just declare variables var string:String;, var xml:Xml, var array:Array<Int> - all broken. Also broken for method's arguments.

Issue has a very negative impact on the intellij-haxe user experience.

Version: next 0.9.9
OSX, IntelliJ IDEA 14.1, 15

image

Repro:

    public function foo(arr:Array<Int>, array:Array<Int>) {
        //array.<caret> ---> doesn't work

        // BUT:
        //arr.<caret>  ---> works
        // rename `array` to `arr` as workaround
    }

    public static function test(string:String, str:String) {
        //string.<caret>
        //str.<caret> -- works

        var xml:Xml = Xml.parse(content); // valid
        var root:Xml = xml.firstElement(); // `firstElement` not resolved

        // no completions and symbol not resolved
        var date = Date.now();
        var year = toExpr(date.getFullYear());
        var month = toExpr(date.getMonth());
        var day = toExpr(date.getDate());
        var hours = toExpr(date.getHours());
        var mins = toExpr(date.getMinutes());
        var secs = toExpr(date.getSeconds());
    }
@as3boyan
Copy link
Contributor

as3boyan commented Feb 6, 2016

I know a limited solution for this, like as you said check if item text matches filename in a case sensetive way. It should help in most cases.

@as3boyan
Copy link
Contributor

as3boyan commented Feb 6, 2016

Also this is duplicate to #234

@eliasku
Copy link
Contributor Author

eliasku commented Feb 6, 2016

Oh, sorry for the duplicate. I'm going to make PR with fix (using your solution), and cover issue with additional unit-tests

@eliasku
Copy link
Contributor Author

eliasku commented Feb 6, 2016

here we go - #406

@as3boyan
Copy link
Contributor

as3boyan commented Feb 6, 2016

This issue might mean that we have wrong type resolution order, but if it is fixes most cases - that is good

EBatTiVo added a commit that referenced this issue Feb 7, 2016
Fix resolution of types and variables with similar names (Issue #234 and #405)
@EBatTiVo
Copy link
Contributor

EBatTiVo commented Feb 7, 2016

Fixed PR #406: d44634b

@EBatTiVo EBatTiVo closed this as completed Feb 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants