-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Add TextFile support across the editor #53025
Conversation
Should we add a default list of TextFile extensions? This would improve the FileSystem dock usability out of the box. I'd suggest something like |
899c5b8
to
6596c7b
Compare
I'm not so fond of having to special case |
The short answer is not really. The longer answer is, if we did remove Given that, the other solution is to modify The only true way to remove it, is to officially support |
Some issues with this PR
|
Aditionally, you maay want to treat JSON as a special case because it can be parsed and throw errors too (Godot JSON object supports this, if parsing is broken it tells you where exactly) |
I think for now, we keep JSON as a plain text file. Then for |
@Paulb23 sounds good, as long as its nothing that will require large compat break we can kick to 4.1 or other minor versions. |
Updated to change |
Personally I don't think that's necessary. It's yet another unique extension for a single file, for a supposed problem which I'm not sure will actually be a problem. It's not particularly useful to open If we want to hide it from the FS dock, I'd special case it there, but in general I'd prefer to merge this PR first, and then we can assess if there's any text file that we don't want to expose for easy opening as TextFile. So I'd leave out da35bc3 (can be kept in case it's wanted later on) to merge this PR otherwise as is. |
da35bc3
to
6596c7b
Compare
Sounds like a plan, removed the commit. |
Thanks! |
Starting to look at improving
TextFile
support in the editor.This PR adds a new editor setting
docks/filesystem/textfile_extensions
that accepts a csv list of extensions e.gtxt,cfg,json
.Any file with those extensions will be visible in the
FileSystem
dock with theTextFile
icon, all normal operations work i.e open, delete, rename etc. Right clicking theFileSystem
dock will allow you to create aTextFile
. Similarly, the inspector can now handleTextFiles
The main file dialogs will have the extensions listed in
docks/filesystem/textfile_extensions
as filters. On top of this,TextFiles
will now appear the in the generalQuickOpen
menu.The system favours the
ResourceLoader
, so iftscn
is in the extension list, it will have no affect. In addition,TextFiles
will not appear in the exporting process or be exported, so will have to use the export filters as usual.Finally, they are not classed as
import_extensions
, so will not litter the project with.import
files.Related godotengine/godot-proposals/issues/677
closes #21787
closes #24187
Unsure where the setting belongs, did think about moving to
ProjectSettings
as each project may use different file types?