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

Provide a way to manually reload an opened file. #186976

Closed
RokeJulianLockhart opened this issue Jul 4, 2023 · 6 comments
Closed

Provide a way to manually reload an opened file. #186976

RokeJulianLockhart opened this issue Jul 4, 2023 · 6 comments
Labels
feature-request Request for new features or functionality workbench-editors Managing of editor widgets in workbench window

Comments

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Jul 4, 2023

#17643 (comment)

  • VSCode Version:1.8.1
  • *OS Version:Windows 7 64 bit

I am trying to analyze the log files. It would be very helpful if i have a feature like a button click or a command to reload a file from disk. I can see the file being reloaded automatically but i am expecting a command to reload the file manually/only when needed.

Any suggestion or help on this feature please?

Thanks,
@Jai1122.

was closed prematurely by

#17643 (comment)

File > Revert File allows to do so. It will fetch the contents of the file from disk even if not dirty.

Reverting is not reloading. I don't want to revert certain files, even temporarily. I want to reload them.

@vscodenpa
Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.79.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@bpasero bpasero added feature-request Request for new features or functionality workbench-editors Managing of editor widgets in workbench window labels Jul 4, 2023
@bpasero bpasero removed their assignment Jul 4, 2023
@vscodenpa vscodenpa added this to the Backlog Candidates milestone Jul 4, 2023
@vscodenpa
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@IllusionMH
Copy link
Contributor

Reverting is not reloading. I don't want to revert certain files, even temporarily. I want to reload them.

What's expected difference with File > Revert File? From description it looks like you want to see (updated) disk content in editor and that's what command would.

@RokeJulianLockhart
Copy link
Author

But, @IllusionMH, it would revert the file to a previous state, wouldn't it? Why else is it called "Revert File" if it's merely acquiring the state from the disk...?

@IllusionMH
Copy link
Contributor

it would revert the file to a previous state, wouldn't it?

I was confused with name as first as well, "File: Revert editor state" would be better if command should contain word "Revert".

AFAIK it's only reverts of editor's model state, e.g. noticeable when it's outdated (not all content of log file shown) or is dirty (changed something without saving).
In case of logs, it won't remove latest log entries from file - it would perform forced read from (disk) file content and update editor model state to match file content. That's not like git revert.

If you just read log file and didn't edit it - you would just see new lines shown in the editor, if you did some edits (dirty state) your unsaved changes will be dropped, and you'll see only content from disk.

If I didn't miss something - this will be method called from editor service

async revert(options?: IRevertOptions): Promise<void> {

@RokeJulianLockhart
Copy link
Author

If it does merely read from storage, only revert the current editor's in-memory changes, I suppose that this can be closed. However, it's hideously named.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality workbench-editors Managing of editor widgets in workbench window
Projects
None yet
Development

No branches or pull requests

4 participants