Skip to content

Update the VS Code editor UI if a server-side document was changed during save #1573

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

Merged
merged 1 commit into from
Jun 9, 2025

Conversation

isc-bsaviano
Copy link
Contributor

This PR fixes #1565. Calling the revert command looks a little hacky, but the end result is the same as the version 2.x behavior.

@gjsjohnmurray
Copy link
Contributor

From a quick read of the code I'm not sure if it always uses revert for classes. Even if it does, I don't recall if 2.x worked that way too.

@isc-bsaviano
Copy link
Contributor Author

You are correct that revert is not always used for classes. It's not used when compilation changes the document because that change will update the mtime a second time. VS Code will see that change and refresh itself automatically without the prodding via revert.

2.x didn't use the same mechanism, but it worked the same way. In 2.x the save was done in an onDidSaveTextDocument handler that ran after the writeFile() and subsequent stat(). In that case, the stat() after writeFile() reported the same mtime as before the write since the file had not been written yet. Then when the write actually happened in the onDidSaveTextDocument handler, VS Code detected that mtime change as not being caused by writeFile() so it updated its UI.

Copy link
Contributor

@gjsjohnmurray gjsjohnmurray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once merged I will start using the beta and look out for any unexpected changes of behaviour during my everyday server-side editing.

@isc-bsaviano isc-bsaviano merged commit 23afff3 into intersystems-community:master Jun 9, 2025
5 checks passed
@isc-bsaviano isc-bsaviano deleted the fix-1565 branch June 9, 2025 15:57
@isc-bsaviano
Copy link
Contributor Author

Thanks @gjsjohnmurray. I plan on doing a 3.0.3 release by the end of the day next Monday so that leaves plenty of time for beta verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server Side changes no longer cause document to reload
2 participants