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

VS Code Extensions should keep their Editors in sync even when files change externally #119

Open
tiagobento opened this issue Feb 16, 2023 · 4 comments
Labels
area:bpmn Related to BPMN area:dmn Related to DMN area:pmml Related to PMML area:tools Issues affecting Apache KIE tooling projects misc:good-first-issue Good for newcomers type:enhancement Something that already exists needs to be improved

Comments

@tiagobento
Copy link

When using VS Code, if you have any file, like my-dmn.dmn open, and you do a git pull that changes this file, the Editor does not update, basically ignoring the git pull you just did. That's just an example, any external change you make to files that are open in VS Code will not update them.

That's really bad, because if you make a change, you'll override what you just pulled.

The expected behavior is that the Editor will reload itself if its associated file changed externally, thus displaying the updated version of the file.

@tiagobento tiagobento converted this from a draft issue Feb 16, 2023
@tiagobento tiagobento added misc:good-first-issue Good for newcomers vscode area:dmn Related to DMN area:pmml Related to PMML area:bpmn Related to BPMN labels Feb 16, 2023
@jomarko
Copy link

jomarko commented Mar 20, 2023

@tiagobento what in case that git pull affects a dmn file, that is being edited, but contains not saved changes. Should be they lost by force or should a modal appear? I think the second one? If yes what should modal to offer to user:

  • just warning and rewrite by force
  • save changes first
  • resolve conflicts
  • ...?

@tiagobento tiagobento added area:tools Issues affecting Apache KIE tooling projects type:enhancement Something that already exists needs to be improved and removed area:vscode labels Apr 24, 2023
@tiagobento tiagobento moved this from Ready to take 🫵 (top to bottom) to Backlog 💭 (unordered) in IBM and KIE Community Project - Archived! May 24, 2023
@tiagobento tiagobento changed the title Sync VS Code Editors with external changes VS Code Extensions should keep their Editors in sync even when files are changed externally. Aug 18, 2023
@tiagobento tiagobento changed the title VS Code Extensions should keep their Editors in sync even when files are changed externally. VS Code Extensions should keep their Editors in sync even when files change externally Aug 18, 2023
@Josephblt
Copy link
Member

Hello @tiagobento, @jomarko. There is a solution using VS Code API FileSystemWatcher implemented in the Extended Services VS Code Extension. We could replicate this for the other editors. I could move the solution to the base code vscode-extension and do only the necessary changes directly to the editors.

As for the conflict handling between file sources, there is no standard way. But, we could do something similar to this:
https://code.visualstudio.com/assets/api/ux-guidelines/examples/notification.png
It is just a matter of using a more appropriate message and accurate buttons. For example, instead of "Accept remote" - Accept local we go with Keep changes - Discard changes. Please let me know what you guys think.

@jomarko
Copy link

jomarko commented Mar 28, 2024

@Josephblt thank you for the link for the notification example. I think, yes, this can be an acceptable solution for the ticket. My only question is, will such notification appear:

  • only on explicit save request from the user? i.e. when user press Ctrl+S?
  • or will such appear also when user has autosave feature turned on?

@Josephblt
Copy link
Member

Josephblt commented Mar 28, 2024

Actually this should appear whenever there are differences between sources and VS Code has focus. Let's say for example, the user reverted changes to a repository using command line. When VS Code gets it's focus back, the popup appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:bpmn Related to BPMN area:dmn Related to DMN area:pmml Related to PMML area:tools Issues affecting Apache KIE tooling projects misc:good-first-issue Good for newcomers type:enhancement Something that already exists needs to be improved
Projects
Status: ⏳ In Progress
3 participants