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

Add a syntax for overriding the underscore-prefix precluding doc generation. #1

Closed
willnationsdev opened this issue Jul 24, 2019 · 3 comments · Fixed by #3
Closed

Comments

@willnationsdev
Copy link

# This function will not show up, because it is prefixed with an underscore
func _bar():
  return 1337

If this does not generate things, then users will be unable to generate documentation about virtual methods that are intentionally prefixed with an underscore and are meant to be overridden by subsequent users. Here is a possible example of using an exclamation point in such a case:

# base_item.gd
extends Resource
class_name BaseItem

#! When using our API to trigger an item, the plugin will automatically call this method
#! on the selected item.
func _use() -> void:
    pass
@TheDuriel
Copy link

Not only virtual methods, but it would require massive refactoring of some projects. The underscore prefix has been advocated as a privacy indicator. "Don't call or use this." My studio is sitting on thousands of lines of code formatted this way.

@Dragoncraft89
Copy link
Owner

After thinking about it for a bit I think there are two things that can be done:

  • Add an option to turn off this behaviour
  • Add hints for the tool to override this behaviour like # [Show] or # [Hide]

I'm just not sure what should be the default behaviour: Hide prefixed methods or show them?

@TheDuriel
Copy link

I'd say be verbose and allow people to change the behavior when needed.

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

Successfully merging a pull request may close this issue.

3 participants