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 for "override function" #92

Closed
kevinresol opened this issue Feb 28, 2017 · 16 comments
Closed

Completion for "override function" #92

kevinresol opened this issue Feb 28, 2017 · 16 comments

Comments

@kevinresol
Copy link

Shows a list of overridable functions at override | or override function |

@Gama11
Copy link
Member

Gama11 commented Feb 28, 2017

I very much want to have something like that as well.

One issue with only allowing it on override is that you can't implement interface methods that way. Doesn't mean it shouldn't be supported though. :)

@Gama11
Copy link
Member

Gama11 commented Mar 2, 2017

Need some kind of support from Haxe for this as well.

@ncannasse
Copy link
Member

Up ? :)

@Simn
Copy link
Member

Simn commented May 6, 2018

HaxeFoundation/haxe#7005

@Simn Simn closed this as completed May 6, 2018
@kevinresol
Copy link
Author

Wait, does this address the original issue? (code completion)

@Simn
Copy link
Member

Simn commented May 7, 2018

No...

@Simn Simn reopened this May 7, 2018
@Gama11
Copy link
Member

Gama11 commented May 7, 2018

Oh, I knew there was an issue for override generation somewhere.. No wonder I couldn't find it. x)

@Gama11
Copy link
Member

Gama11 commented Jun 7, 2018

This is supported now:

(still a few known issues to work out, but most cases work fine)

@Gama11 Gama11 closed this as completed Jun 7, 2018
@ncannasse
Copy link
Member

Can we remove the "public" that is added ? By default, override should not increase the visibility of the method (in case we change it to private later)

@Simn
Copy link
Member

Simn commented Jun 8, 2018

It only adds that if the overridden field is public too.

@ncannasse
Copy link
Member

ncannasse commented Jun 8, 2018 via email

@Simn
Copy link
Member

Simn commented Jun 8, 2018

Uhm okay, I thought it would be a compiler error if we don't have the public there. That's how it behaves for interfaces, but not for overrides. Isn't that inconsistent?

@kevinresol
Copy link
Author

I am used to that behaviour, to me it just mean "inherit the access"

@Gama11
Copy link
Member

Gama11 commented Jun 8, 2018

I don't really like that Haxe feature to begin with... Visibility in classes defaulting to private except for overrides of public methods hurts readability / is confusing, in my opinion.

If there's really a demand for it (which I doubt at the moment), we could add a code style setting for this, but I'd still like public access to be explicit by default. Note that FlashDevelop, which this feature is copied from, adds public as well.

@ncannasse
Copy link
Member

ncannasse commented Jun 8, 2018 via email

@Gama11
Copy link
Member

Gama11 commented Jun 9, 2018

I've added explicitPublic and explicitPrivate options, which you can specify like this if you want visibility to always be explicit:

"haxe.codeGeneration": {
    "functions": {
        "field": {
            "explicitPublic": true,
            "explicitPrivate": true
        }
    }
}
explicitPublic - Whether to include the public visibility modifier even if it can be omitted
explicitPrivate - Whether to include the private visibility modifier even if it can be omitted

The default value for both is false.

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

4 participants