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

Allow to make edits to binary files #2582

Closed
06needhamt opened this issue Jan 31, 2016 · 37 comments
Closed

Allow to make edits to binary files #2582

06needhamt opened this issue Jan 31, 2016 · 37 comments
Assignees
Labels
custom-editors Custom editor API (webview based editors) *extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality workbench-editors Managing of editor widgets in workbench window
Milestone

Comments

@06needhamt
Copy link

Hi

I am requesting that an option to open a file in the binary editor like in visual studio should be added into visual studio code

Thanks in Advance

@aeschli aeschli added the feature-request Request for new features or functionality label Feb 1, 2016
@aeschli aeschli added this to the Backlog milestone Feb 1, 2016
@bpasero bpasero added the file-explorer Explorer widget issues label Apr 7, 2016
@bpasero bpasero self-assigned this Apr 7, 2016
@06needhamt
Copy link
Author

Any ETA on this yet?

@asif-mahmud
Copy link

definitely needed feature. watching for it ..

@bpasero
Copy link
Member

bpasero commented Jul 15, 2016

There is at least a viewing extension now: https://marketplace.visualstudio.com/items?itemName=slevesque.vscode-hexdump

image

@dave5
Copy link

dave5 commented Aug 10, 2016

This is the key impediment to me implementing my work in VSCode. I would dearly love to move my focus from atom to VSCode.

@bpasero
Copy link
Member

bpasero commented Aug 10, 2016

@dave5
Copy link

dave5 commented Aug 10, 2016

I looked at it. I didn't feel that it got me to where I wanted. I will revisit when I have some more bandwidth, but I was keen for the ability to write extensions that handled arbitrary file types. My processes get fairly complex and having to roll my own file parsing to get around this restriction is an added overhead.

Being limited by bandwidth I can either stick with atom and not have to worry about reading binary file types, or I move across to VSCode and add it to my todo list 😄 ... sadly (as I fell hard for VSCode) and easy choice right now.

@dave5
Copy link

dave5 commented Aug 15, 2016

I had a further play. The approach works ok if I am happy to explicitly point to the file from within the extension, but I want to click on the file and have VSCode hand off rendering transparently... see here.

The "else" at the bottom of vscode/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts seems to preclude this as a possibility right now...

@bpasero bpasero removed their assignment Aug 17, 2016
@af4jm
Copy link

af4jm commented Sep 13, 2016

The simple fact that VSCode aborts opening a file because it doesn't recognize its format is a VSCode bug. This thread isn't requesting a feature missing from VSCode, it's describing a bug in VSCode. Only work-around I've found is to keep Notepad in my Send To menu, and the whole idea of VSCode is to offer a better alternative to Notepad, something it's thus far falling short of.

@06needhamt
Copy link
Author

@af4jm Do you know where this check is in the source so i can take a look?

@dave5
Copy link

dave5 commented Sep 13, 2016

@06needhamt Look in: vscode/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts

@corvinrok
Copy link

corvinrok commented Oct 4, 2016

What is the status of this feature request? Will it be added to committed portion of the backlog? If so, when?

@loligans
Copy link

It would be nice if we could at least get the filename and filepath of binary files that are open in the editor.

A use case would be opening an encrypted file using an extension.

@tosone
Copy link

tosone commented Jun 14, 2017

Just give me something about the file stat infomation or anyother information. I think it is very nice.

@loligans
Copy link

loligans commented Jul 22, 2017

Should VSCodeBot be added to this feature request for tracking purposes?

@bpasero bpasero added workbench-editors Managing of editor widgets in workbench window and removed file-explorer Explorer widget issues labels Nov 17, 2017
@bpasero bpasero removed this from the Backlog milestone Nov 17, 2017
@Ethan-VisualVocal
Copy link

Ethan-VisualVocal commented Jan 11, 2018

Please please keep this in mind as a future feature!! This is now the only reason I keep Sublime Text 2 installed. I can tell it to open any file, and then I can tell it to attempt to interpret it with a specified encoding.

Here's me using Sublime Text to look at some XMP metadata in a 1.6MB JPG file:
image

Here's an 8KB .mobileprovision file used in iOS dev that VS Code won't display either:
image

I mention these specific examples because a hexdump extension is not sufficient for these kinds of scenarios, and when this feature gets implemented for VS Code it should be more robust than just a hexdump.

@billbruntold
Copy link

Hi -

Yes, would very much like to see this capability. Have been using EditPad Pro for years and decided to get on board with a more popular editor (EditPad Pro is awesome though!). Started to like VS Code and then discovered it does not support binary editing.

  • Bill

@billbruntold
Copy link

Hi -

Has anyone tried this one: https://marketplace.visualstudio.com/items?itemName=slevesque.vscode-hexdump ?

73,836 installs and counting....so obviously people have tried. Will check out reviews etc. there.

Bill

@loligans
Copy link

loligans commented Feb 14, 2018

Building upon what @Ethan-VisualVocal said. All I need is the file path to a binary file. That way I can decrypt the file before opening it into the editor using an extension I wrote myself.

To make things more interesting, some files can be opened that contain invalid data. For instance this is an image of the editor displaying a pdf file raw.
Image of editor displaying a pdf file raw

@ograndebe
Copy link

As a bootstrap to this feature you could put some plain file information about the binary file, as:
modified date, path, size, a button to open with OS editor, this simplier things that helps a lot.

@Wolfy7
Copy link

Wolfy7 commented Aug 21, 2018

Hexdump is a great extension but i think also this feature should be served from vscode not a extension.
And it would be create to have the option to open files directly in "hex-view" like the context menu entry from PSPad
grafik

@maxeonyx
Copy link

maxeonyx commented Sep 3, 2018

IMO The hex viewer does not really need to be added to the editor. What would suffice instead is an extension hook that properly delegates handling of a binary file to an extension. Does anyone know if this is currently possible? If not, does anyone know if there is an issue open for it?
Although I agree with @ograndebe that the default view should include some basic information.

@burner1024
Copy link

@maxeonyx I agree. I need to decompile a binary file with an external tool and then display the source in the editor normally. As far as I can see, currently it's not possible.

@bpasero bpasero changed the title Add Binary Editor Feature Allow to make edits to binary files Sep 19, 2018
@emackey
Copy link

emackey commented Sep 25, 2018

If a user opens a binary file that my VSCode extension recognizes, I would like my VSCode extension to override the default view of "binary or unsupported text encoding" and show a custom view instead.

@mrkev
Copy link

mrkev commented Nov 25, 2018

Big +1 to this. Started working on an extension to display read-only binary files of a specific type, but it's inconvenient they have to go through a text-editor first.

I'd be happy to help bring this about. (:

@fmonroe
Copy link

fmonroe commented Jan 16, 2019

As mentioned above by Maxeonyx, this best describes what I'm looking for:
"What would suffice is an extension hook that properly delegates handling (reading and writing) of a binary file to an extension."
In other words: I need to de-compile a binary file with my extension and then load the source in the editor normally, on 'save' the extension should be able to handle the source and save it (compiling it) to the binary format.

@hillmarcus
Copy link

Any update on this? I'm finding myself in need a hex editor and I would prefer to use VS Code if it had a proper editor. Hex Dump is lacking for anything more than viewing the file.

@bullub
Copy link

bullub commented Jul 3, 2019

Can you provide binary editing and highlighting? Can it be like Synalyze It?

@andrey6498
Copy link

Shame that there's only clumsy ways to operate with binary files. And why vscode still unable to edit hexadecimal files? Universal as said but no hexadecimal files support. Viewing is almost ok. Still need adequate hex editing.

@asif-mahmud
Copy link

asif-mahmud commented Oct 4, 2019 via email

@TomasHubelbauer
Copy link
Contributor

Could #82115 be a solution to this? I read the release notes for the latest version and one thing that stood out was that image preview was not an extension of its own. That surprised me, because I knew the API didn't issue onDocumentOpen events for non-text and non-PDF files, which was a major blocker for this functionality and others (like my idea for video previewer). The linked issue looks like it could allow one to associate (wildcard or at least some specific) binary extensions with a custom editor!

I would still like this to be a built-in VS Code feature as I believe editing experience is too core and there is a risk of delegating it to a 3rd party extension in that it might have a UI which doesn't feel native, support accessiblity, localization, keyboard shortcuts etc. the same way and stay behind on important developments to the core editing experience, but it's definitely better than nothing!

@bpasero bpasero added this to the Backlog milestone Oct 24, 2019
@jsilvermist
Copy link

Just ran into a need to edit a binary file and really sad to see this isn't possible in VS Code yet, it's the first time I've needed to go back to Sublime Text in a very long time.

@bpasero bpasero added the custom-editors Custom editor API (webview based editors) label Jan 19, 2020
@sportshead
Copy link
Contributor

I'm attempting to implement this:
https://github.com/sportshead/vscode/tree/issue-2582-hex-editor

Feel free to try and help me!

@barneym
Copy link

barneym commented May 2, 2020

It seems like this thread is conflating three entirely different use cases:

  1. Ability to "on demand" allow extensions to decode on open, allow editing of the decoded content, and then re-encode on save. This supports binary formats like Applescript's (scpt) files. This functionality already exists for extensions in alternative editors like Atom. It's also necessary for existing extensions (i.e. Applescript idleberg.applescript) which suffer from this limitation.

  2. Ability to open files that VSCode believes to be binary, but are believed by users to be editable. This could extend to pseudo text formats like RTF or PDF where it is possible to edit the files in a text editor to achieve desired results as long as the encoded headers of the file don't become mutated by VSCode. Allowing this through extension override and insuring VSCode doesn't mutate any displayed control characters on open/save seems a reasonable approach and can be achieved in many text editors like notepad and textedit.

  3. Ability to open purely binary codes to introspect or edit, such as being repeatedly suggested via Hex Dump extension. While a great extension, it's entirely unrelated to use case Open Source VS Code #1 and gulp-symdest does not preserve links on electron #2 which seems to be the missing functionality that is actually being asked for in this thread. And no doubt having those capabilities would allow for even more functional hex extensions in the future.

Just an observation.

@lramos15
Copy link
Member

I believe a lot of these cases will become possible with the release of 1.4.6 and the custom editor API which is currently in a proposed state. https://code.visualstudio.com/api/extension-guides/custom-editors. This milestone does currently contain a hex editor implementation utilizing that API that I will be working on in the next couple of months. I welcome everyone's feedback to what they would like to see in a custom hex editor.

@mjbvz mjbvz self-assigned this May 18, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented Aug 11, 2020

The hex editor extension adds support for both viewing and editing binary files

Give it a try. If there any features you think are missing, please open new issues against that extension

@mjbvz mjbvz closed this as completed Aug 11, 2020
@mjbvz mjbvz added the *extension-candidate Issue identified as good extension implementation label Aug 11, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
custom-editors Custom editor API (webview based editors) *extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality workbench-editors Managing of editor widgets in workbench window
Projects
None yet
Development

Successfully merging a pull request may close this issue.