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

Support file operations on non-textual files #63

Merged

Conversation

iliashkolyar
Copy link
Contributor

Fixes #57 by supporting source path retrieval for non-textual files.

@iliashkolyar
Copy link
Contributor Author

The bug was a failure to retrieve the source path of a non-textual file.
This failed not only the delete action, but basically every command that was triggered on this type of files.

Since I could not find any API that handles non-textual files (and thus could not get their source path), the solution was using the VS code copyPathOfActiveFile API and running some clipboard manipulations.

Unfortunately, due to this reason, I could not add a test for this scenario as I could not find a way of opening a non-textual file to begin with.
The following:

const uri = Uri.file(<path_to_binary_file>);
workspace.openTextDocument(uri);

Would return the following error: "cannot open <path_to_file>. Detail: File seems to be binary and cannot be opened as text", and I could not find any similar API for non-textual files.

@sleistner sleistner merged commit 392dad2 into sleistner:master Nov 2, 2018
@sleistner sleistner added bug Indicates an unexpected problem or unintended behavior enhancement Indicates new feature requests labels Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants