Skip to content

Attaching new script case sensitivity #106304

Closed as not planned
Closed as not planned
@martin951

Description

@martin951

Tested versions

v4.4.1.stable.steam [49a5bc7]

System information

Windows 11 - v4.4.1.stable.steam [49a5bc7]

Issue description

When you attach a script that already exist, but the file name casing does not match, a new file is created that inherits the original script code.

For example you have:
MyScript.gd file which has class_name MyScript

You attach new script to a node and name it myscript.gd.
The editor says you LOAD an existing script and duplicates the existing code, but
the editor handles this script as unique > you have both MyScript.gd and myscript.gd in the code editor.

In this case you get an error (in the myscript.gd file) that class MyScript hides a global script class.

Steps to reproduce

Create a MyScript.gd file.

in the scene editor, create any kind of node and attach new script to it. set the path to be the same as MyScript.gd and set the name to have different casing. For example myscript.gd.

attach the new script.

code editor should have the contents of MyScript.gd but the file is treated as unique script.

Minimal reproduction project (MRP)

I hope steps to reproduce are simple enough

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions