Skip to content

Server Side changes no longer cause document to reload #1565

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

Open
isc-jsmith opened this issue May 27, 2025 · 4 comments
Open

Server Side changes no longer cause document to reload #1565

isc-jsmith opened this issue May 27, 2025 · 4 comments

Comments

@isc-jsmith
Copy link

isc-jsmith commented May 27, 2025

We're using a derivative of the source control hooks that isc.codetidy is based on to enforce consistent formatting in via our server side source control hooks. We've found that since version 3.0.0 of the ObjectScript plugin the changes are no longer causing the modified document to appear in VSCode. The hooks are running correctly - if I create or update a document using the Atelier API directly, the content is returned with the correct formatting. Closing and reloading a document causes the updated formatting to appear. If I roll back to 2.12.10 of the plugin then the document is reloaded after saving.

I've attached my example API calls made using Postman.

atelier-response.json

atelier-body.json

$zv = IRIS for UNIX (Red Hat Enterprise Linux 9 for x86-64) 2024.1.1 (Build 347_0_24046U) Thu Apr 3 2025 00:25:59 EDT

@isc-bsaviano
Copy link
Contributor

Hi @isc-jsmith, thanks for reporting this. Do you have objectscript.compileOnSave on? Can you send me a simple source control class I can use to reproduce this issue?

@isc-jsmith
Copy link
Author

Hi @isc-bsaviano,

Yup. I have "compileOnSave" enabled. I've emailed you the Source Control hook.

@isc-bsaviano
Copy link
Contributor

I think this might be a VS Code core issue. See microsoft/vscode#249906.

@isc-bsaviano
Copy link
Contributor

The linked VS Code was closed because VS Code is working as designed. It expects the text of the document written to not change due to the write without another change in the document's mtime. There is an onWillSaveTextDocument event that I can use in VS Code to delay the save until we can round-trip with the server and update VS Code's copy of the document. However, I don't like this approach because if it takes too long VS Code will stop delaying. This is definitely possible if source control hooks are enabled that require user actions. I also don't like having to "pre-save" the document, and then have our writeFile() handler do nothing. @gjsjohnmurray @isc-rsingh What do you think?

@isc-jsmith You can work around this by having your source control hook update the class's timestamp when it modifies the document. VS Code will detect that change and show the updated text. This is what the compiler does when it modified the document (for example, changing the Storage when a new Property is added).

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

No branches or pull requests

2 participants