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

Autocomplete does not work for List elements and abstract classes #772

Closed
RedHead90 opened this issue Mar 15, 2018 · 4 comments
Closed

Autocomplete does not work for List elements and abstract classes #772

RedHead90 opened this issue Mar 15, 2018 · 4 comments
Assignees

Comments

@RedHead90
Copy link

var list:List<Something> = new List();

for(element in list) {
    element. //no code tips here
}

This does not work, because the List.iterator() method returns a exemplar ListIterator. If I change it to an Iterator, then the autocomplete starts working.

@:forward
abstract AbstractWrapper<T>(T) from T to T {
    public inline function new(value:T) this = value;
}

var obj:AbstractWrapper<Something> = new Something();
obj. //no code tips here

These problems are not present if you enable the checkbox Use compiler in the SDK settings.

@mayakwd
Copy link
Contributor

mayakwd commented May 14, 2018

Iterators already fixed in the EAP build, second issue still reproducing.

@EricBishton
Copy link
Member

Tweaking the code a bit gives some of the functionality:

package ;

@:forward
abstract AbstractWrapper<T>(T) from T to T {
    public inline function new(value:T) this = value;
    public function extraFunctionality() : T {return this;}
}

class TestIssue772 {
    public function new() {
        var obj:AbstractWrapper<String> = new String();
        obj.      //no code tips here
    }
}

image

As you can see, functions defined within the AbstractWrapper are available for completion. However, I think the disconnect is that we don't process the to functionality when we walk the class hierarchy looking for candidates.

@RedHead90
Copy link
Author

RedHead90 commented Nov 18, 2018

Sorry for my English. I`m really looking forward to this fix. And now it has become even more critical, because in Haxe 4 preview versions, Null<T> has also become an abstract type. Now he looks exactly like my example and autocomplete does not work even for such trivial things as Null<String>.

@EricBishton
Copy link
Member

Will be in release 1.2.

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