Restrict Autoloads from having keywords as their names #24365
Merged
+30
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A re-take on #22107, fixes #17494.
A comment in the original PR suggests using
ScriptServer::is_scripting_enabled()
, but as it always returnsfalse
, this condition is not used.Some small enhancements where also added:
Enter
while having the name field focused now counts as having pressed "Add".While doing this, I also made an interesting discovery: Classes registered which names start with "_" (such as
_Engine
,_OS
, etc), even though they can be identified without the underscore while scripting, searching for it in theClassDB
will result in nothing without it.This explains why you can name Autoloads which such classes, and also why they don't inherent the
Object
icon in the new Editor Help dialog.Now here's the question: Should we make those two places also check the class names with "_" when searching the database, or should something be done in the
ClassDB
itself?UPDATE: The above can be fixed by either #26990 or #26922.