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

Hide private func and variables in editor #23110

Closed
xDGameStudios opened this issue Oct 18, 2018 · 3 comments
Closed

Hide private func and variables in editor #23110

xDGameStudios opened this issue Oct 18, 2018 · 3 comments

Comments

@xDGameStudios
Copy link
Contributor

Issue description:
This is more a suggestion and not a bug. We all know that all funcs and variables are public in godot, but it would be great if we could hide wanted funcs and vars from autocomplete from outside the script. For example:

`#my_class.gd
class_name MyClass

var public_var
hide var _private_var
`

`#my_refering_class.gd

var instance:MyClass
`

when refering to instance in the second file I won't get auto-completion for the hidden variables only the non hidden (kinda like a public private but only for auto completion this could work also with funcs)

@Zylann
Copy link
Contributor

Zylann commented Oct 18, 2018

I though these would inherently never popup because they start with _ and I never write something._ :s It's weird that they would still appear (as long as you don't type ._ of course), and if they do, they would likely be the last suggestions since _ is not a letter?

Otherwise that could be yet another one for #20318, unless there is a consensus to consider ._xxx to be understood by autocomplete and hidden de facto.

Notes:

  • _ doesn't differentiate the private and protected OOP terms
  • There are cases where we do self.xxx
  • Also .xxx() to call base functions

@xDGameStudios
Copy link
Contributor Author

xDGameStudios commented Oct 18, 2018

That could also be an option "_" be considered automatically as hidden... when making a base class
for example DataGrid, that has some arrays and some public functions, I don't want the end user to access the underlying array properties for example. I understand that he may be able to access them anyway but at least it doesn't come in the autocomplete..

@clayjohn
Copy link
Member

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

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