-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
opening large or binary files #8152
Conversation
Is monaco supporting streaming now or will we just stream and buffer the content before giving it to the editor? |
Yes, there are internal Monaco APIs which allow it: https://code.visualstudio.com/blogs/2018/03/23/text-buffer-reimplementation |
446e385
to
aef2b6e
Compare
522f5b9
to
d55019f
Compare
It works, but it is slow for Electron compare to VS Code. We need to bind |
55613a1
to
4041d16
Compare
@akosyakov I try to merge as described in the command line instructions and there are many merge conflicts to solved |
Can't you just checkout branch
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified the functionality of the pull-request and it works as described 👍
Browser:
- opening a binary file triggers a prompt
- opening a file smaller than the preference value does not trigger a prompt
- opening a file larger than the preference value triggers a prompt
- modifying the preference value is respected
Electron:
- opening a binary file triggers a prompt
- opening a file works like
master
I only used the branch for the large file, unable to merge with "git merge akosyakov/integrate-vscode-api-7269", it triggers many conflict merge. |
After trying to open a large file, I forgot to put the error I see on the console log
Then I can open any small file after that in preview mode as I said earlier |
I tried to open |
thanks for testing, |
4041d16
to
54d7a5e
Compare
@lmcbout @a1994846931931 Could you try again? I've fixed issues with the editor preview extension. There is still some weirdness but it is out of the scope of this PR: #8168 |
After trying to open a binary file, if I select "Yes" | "No" , I can open any small files in preview after 👍 FIX As @a1994846931931 mentioned, If I try to open a large file and it happens that this file is an executable, there are two popup dialogs, we should only have one popup. |
I agree that UX wise is not really good, but I don't feel that it is right to open a binary file if one agreed to open a large file. Unfortunately I cannot to do checks together to add have only one prompt, since the size check is cheap I need only the stat, but to check for binary content I had to actually open the file and fetch in the worst case more than 100kb. I would prefer to keep it like that for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that UX wise is not really good, but I don't feel that it is right to open a binary file if one agreed to open a large file. Unfortunately I cannot to do checks together to add have only one prompt, since the size check is cheap I need only the stat, but to check for binary content I had to actually open the file and fetch in the worst case more than 100kb. I would prefer to keep it like that for now.
UX wise not great, I agree. We should not try to open executable file , so I agree to accept this PR as it is right now.
Thanks @akosyakov for your work
5cf3072
to
f408df3
Compare
54d7a5e
to
d159210
Compare
87c7840
to
a8d9c09
Compare
d159210
to
b4d0280
Compare
Signed-off-by: Anton Kosyakov <[email protected]>
Signed-off-by: Anton Kosyakov <[email protected]>
Signed-off-by: Anton Kosyakov <[email protected]>
…large files Signed-off-by: Anton Kosyakov <[email protected]>
b4d0280
to
b2097c1
Compare
What it does
fix #3859, fix #4731
Important: the goal of this PR is to prevent a user to crash the browser tab, it does not aim to improve performance in the electron case. See also: #8152 (comment)
Out of scope:
How to test
Review checklist
Reminder for reviewers