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 error emitting when double-clicking on JSON files in FileSystem tab #67739

Closed
wants to merge 2 commits into from

Conversation

DrewV3
Copy link

@DrewV3 DrewV3 commented Oct 22, 2022

Fixes error thrown when clicking on a json file in the file dock

Bugsquad edit: Fix #66820

Fixes error thrown when clicking on a json file in the file dock
@YeldhamDev YeldhamDev added this to the 4.0 milestone Oct 22, 2022
@YeldhamDev YeldhamDev linked an issue Oct 22, 2022 that may be closed by this pull request
editor/editor_node.cpp Outdated Show resolved Hide resolved
Copy link
Member

@Paulb23 Paulb23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will no longer open scenes using the filedock if .tscn exists in the list of textfile_extensions. We have to give priority to the ResourceLoader.

@DrewV3
Copy link
Author

DrewV3 commented Oct 23, 2022

Is that not the desired effect of adding .tscn to the list of textfile_extensions? As I understood it, the list of textfile extensions existed for the purpose of causing those files to be editable in the script editor instead of being imported. That's why none of the default items in textfile_extensions are resource types.
image

Fixed whitespace issue
@Chaosus Chaosus changed the title Fixed #66820 Fix error emitting when double-clicking on JSON files in FileSystem tab Oct 23, 2022
@Chaosus
Copy link
Member

Chaosus commented Oct 23, 2022

Please squash the commits as required by our pipeline and amend the commit name to be correct (we don't accept names like "fixes [link]").

@Paulb23
Copy link
Member

Paulb23 commented Oct 23, 2022

textfile_extensions do not prevent the Resource from being imported. They where designed as a catch all for editing (text) files that are not imported (non-resources), but are still needed as part of development.

There is nothing stopping users from adding .tscn to the list and nor should we prevent it, as the user may have an engine plugin to edit other filetypes. We cannot not know this, hence we need to give priority to the ResourceLoader. As the user shouldn't have to edit their settings every time they open different projects.

Opening items in the filesystem dock should always take you to the dedicated editor for that Resource, regardless of what's in textfile_extensions. As the dedicated editor will be specialised to edit the Resource, as such should be the preferred workflow.

However, there is no prevention stopping the user from opening up a .tscn file if they wish, directly via ScriptEditor menus which bypasses textfile_extensions checks. Though not recommended.

@akien-mga
Copy link
Member

Superseded by #72259.

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.

Double clicking JSON files in FileSystem tab throws errors
5 participants