Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

feat: more file types available in file editor (#975) #973 #975

Merged
merged 5 commits into from
Dec 22, 2020
Merged

feat: more file types available in file editor (#975) #973 #975

merged 5 commits into from
Dec 22, 2020

Conversation

Animus-Surge
Copy link
Contributor

Small update to the file editor I pushed a while ago, adding python and a few other extensions to the list of file types that are able to be opened by eDEX

@wrac4242
Copy link
Contributor

created a pull request, adding more cases in.
How does this deal with hidden files? the files that start with a .
and how would it deal with files without an extension

@Animus-Surge
Copy link
Contributor Author

Animus-Surge commented Dec 21, 2020

How would this deal with hidden files?

As far as I know, if it's a supported file type, it should open it. (Now that I'm thinking about it I'm going to add .gitattributes and .gitignore files to the list of file types that can be opened in the file editor).

As for files without any extension, it doesn't open them. I suppose there could be a check somewhere that determines if the file has no extension, but I'm not sure where and why you'd need to edit them.

I'm also not sure why the linux build failed here.

@wrac4242
Copy link
Contributor

it looks like it failed because it could not update/install dependencies, there are a few, mirror not found errors

@GitSquared
Copy link
Owner

Don't worry about the linux builds, it's an external issue, i'll look into it.

Copy link
Owner

@GitSquared GitSquared left a comment

Choose a reason for hiding this comment

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

I feel like we may want to use mime-types, or an NPM library with file extensions, instead of managing dozens of file extensions ourselves. Could you look into this?

Some pointers:

@GitSquared
Copy link
Owner

Don't worry about the linux builds, it's an external issue, i'll look into it.

I've fixed CI builds, by the way, you can rebase your PR to get green checkmarks ✔️

@Animus-Surge
Copy link
Contributor Author

Gotcha. I’ll look into this.

@Animus-Surge
Copy link
Contributor Author

Alright, now it's using MIME types to check the filetype. Only problem is now it opens binary files as well (files like Windows Desktop Shortcuts and DLLs), but for now at least it opens any registered file type.

Copy link
Owner

@GitSquared GitSquared left a comment

Choose a reason for hiding this comment

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

I've pushed some changes to leverage mime.charset() as a way to tell which files are text-editable. Tell me what you think, this is mergeable for me.

@Animus-Surge
Copy link
Contributor Author

Looks good to me! Think we're ready here.

@GitSquared GitSquared changed the title Add more file types to the file editor feat: more file types available in file editor (#975) #973 Dec 22, 2020
@GitSquared GitSquared merged commit a8e29ce into GitSquared:master Dec 22, 2020
@GitSquared
Copy link
Owner

@Animus-Surge @wrac4242 thanks for helping out!

eugene2candy pushed a commit to eugene2candy/edex-ui that referenced this pull request Apr 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants