code
code copied to clipboard
*.html is not a text file on sshftp server
Current behavour: code is not showing .html files in the sidebar and throws an error when I open them
Expected: html files editable and on sidebar.
I don't know why it's doing this, surely nobody would let this behaviour slip through. I'm on stable.
edit: the file was on an sshftp session, seems to work fine on local machine.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Please look at the properties of the file you cannot open using Files or otherwise. What mime-type is it? What are the permissions? I just tried to open an html page downloaded from the web (mime-type text/html) and it opened OK (although my version of Code is compiled from master source)
Also, what happens if you press "Load Anyway"?
At the moment, Code warns if the file mime-type is not a subtype of "text/plain".
load anyway opens the file, the file is owned by me and the permissions are fine, but it's on an sshftp session to an lxc-container. when I cloned the repo down to my projects folder it worked fine, I'll edit the bug to reflect this.
Maybe the content type could not be determined in that situation. Perhaps Code should fallback to to relying on the extension in that case. At least the warning words could be improved.
I have the same problem on a local file. Html is not being shown on the editor.
Can also confirm this is the case for me still in elementary OS 6. Load anyway still solves it, but this sorta breaks workflow if you need to open multiple html files over ssh.
May be better to not check in advance and just give indication if loading fails.
More frustratingly, this also prevents html
and other text-like files from being shown in the left sidebar when you open a project folder that's a mounted remote sftp file.
I do not think that Code was initially envisaged to be used to edit remote files over e.g. sftp. I do all my development locally. But if users want it and the git library works properly over such protocols (from inside a flatpak) I guess its something that could be implemented.
I am going to close this as I do not think the intended use of Code is to edit documents over SFTP (or other remote protocol). Performance over a remote link is likely to be poor. Please download the file, edit it, and then upload.
I have not found any issue editing simple .html
files locally. Editing over SMB also worked albeit with significant lag when autosave
was ON. The html files were shown in the sidebar.
Please reopen with an example problematic html file which either cannot be edited or does not appear in the sidebar when local.