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

Fix incorrect script check #90959

Closed

Conversation

quirkylemon
Copy link
Contributor

I think the issue was caused by 'script.is_valid' returning true but the path being empty.
fixes #90467

@akien-mga akien-mga requested a review from dalexeev April 20, 2024 22:33
@akien-mga akien-mga added this to the 4.3 milestone Apr 20, 2024
@fire fire changed the title fix incorrect script check Fix incorrect script check Apr 21, 2024
@dalexeev
Copy link
Member

Sorry, I think this is an incorrect solution. You are using Array[BaseNativeType] instead of Array[PathlessScriptType], but these types are incompatible with each other in both directions. Even if this "fixes" it for the debugger (see also #90751 (comment)), binary serialization is not just for the debugger. Error reporting when the script has an empty path was intentional in #78219.

The cleanest solution I can imagine would be to introduce fully qualified type names (FQTN), which would allow any type to be universally and uniquely identified:

FQTN proposal fragment
  • ClassDB types (Object, Node, etc.).
  • Global script classes. Must be unique for all languages. Namespaces are possible, in which case some separator is used (., :: or something else).
  • Unnamed script classes in the res:// file system (like "res://script.gd").
  • Scripts created on the fly (like "gdscript://12345"). The protocol defines the scripting language, followed by the script instance id.
  • Enumerations, inner classes and structures use .. For example GlobalClass.InnerClass or "res://script.gd".InnerClass.MyEnum.

But it's more complicated than it seems. We can't just introduce a new format in one place without thinking about others. So for now I would look for other workarounds, on the debugger / editor UI side.

@akien-mga
Copy link
Member

Superseded by #94379. Thanks for the contribution!

@akien-mga akien-mga closed this Jul 17, 2024
@akien-mga akien-mga removed this from the 4.3 milestone Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typed arrays with custom types don't show up in the debugger's variable stack
3 participants