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

Completion fails if function is optional #409

Closed
haxiomic opened this issue Jan 17, 2020 · 3 comments · Fixed by vshaxe/haxe-language-server#46
Closed

Completion fails if function is optional #409

haxiomic opened this issue Jan 17, 2020 · 3 comments · Fixed by vshaxe/haxe-language-server#46

Comments

@haxiomic
Copy link
Contributor

haxiomic commented Jan 17, 2020

If a function has @:optional metadata, completion fails for that type. In the following example, there will be no completion for example, but if you remove @:optional, completion works.

class Main {
    
    static function main() {
        var example: {
            function test(): Void;
            @:optional
            function optionalTest(): Void;
        } = null;

        example.|
    }

}

I had a similar bug in my sublime plugin – I assumed if kind is 'method', then type will be a function signature, however the function signature is wrapped in Null<T> so it fails to parse as a function. I.e., the type returned from haxe --display of the method optionalTest() is Null<Void -> Void, which doesn't parse as a function signature

@haxiomic
Copy link
Contributor Author

haxiomic commented Jul 1, 2020

Seems to be happening again in v2.21.0

@Gama11
Copy link
Member

Gama11 commented Jul 2, 2020

Looks like the fix for #449 covers this too.

@haxiomic
Copy link
Contributor Author

haxiomic commented Jul 2, 2020

Awesome stuff! Thanks @Gama11 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants