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

Sometimes cannot save files #37

Open
nyanpasu64 opened this issue Nov 2, 2024 · 6 comments
Open

Sometimes cannot save files #37

nyanpasu64 opened this issue Nov 2, 2024 · 6 comments

Comments

@nyanpasu64
Copy link

Does this issue occur when all extensions are disabled?: idk, can't load partial block editors without extensions?

  • Haystack Version: 0.19.3
    VS Code Version: 1.90.0
    Chromium: 122.0.6261.156
    OS: {3 } (Arch Linux)

Steps to Reproduce:

  1. Open a file in rust-analyzer.
  2. Drill down to a struct impl block or similar.
    • You may need multiple editors for multiple files or blocks within a file? IDK.
  3. Edit the file and press Ctrl+S to save it.

I'm not sure what triggers this, but sometimes the file will not save and the x in the title bar will remain a circle. The last time this happened, the red squigglies from rust-analyzer will disappear and reappear (in positions desynced from the current document's textual state), but I could not save the file (and make the titlebar x reappear) until I returned to the top-level file. I don't know if the file was being saved to disk or not.

One time I got Haystack into a state where I couldn't type into the active editor. It was not from Ctrl+M "tab moves focus". I'm not sure how that happened.

@nyanpasu64 nyanpasu64 changed the title Sometimes cannot save files (from partial block editors?) Sometimes cannot save files Nov 2, 2024
@nyanpasu64
Copy link
Author

  • The bug triggered again while I was editing in a full-file editor.
  • The file was not successfully saved on-disk.
  • Entering and exiting a sub-file block allowed saving again.

I wonder if the issue is related to setting the dirty flag (eg. from rust-analyzer add imports, auto-format) in one block vs. another.

@AkshaySG14
Copy link
Contributor

I think one band-aid fix would be to force CMD/CTRL+S to save to disk regardless. Do you have any tips on how to repro either the save bug or the "can't type in editor bug"?

@nyanpasu64
Copy link
Author

  • At one point saving failed because I had run cargo fmt with unsaved changes in Haystack, then the bottom-right notification prompted to overwrite changes on disk, then merge changes (possibly supposed to be in a diff view that didn't load), using buttons on the editor toolbar (but they didn't load since you replaced the editor toolbar). The 2 occurrences from when I reported this bug did not have the notification.
  • Possibly auto-formatting with rust-analyzer (ctrl-shift-i) then saving? IDK.

@AkshaySG14
Copy link
Contributor

When you couldn't type into the active editor, was that because you were in a subset view? If so, the bug makes some amount of sense and I have an idea for the fix.

@nyanpasu64
Copy link
Author

I don't remember if that's the case. Personally as a developer I think it's "wiser" to put logging into programs and gather data about what's happening, rather than fixing based off hypotheses, though I wouldn't say I universally follow my own advice.

@AkshaySG14
Copy link
Contributor

This should be fixed in 0.19.4! I added editor actions into the main toolbar and "compare changes" should not be broken anymore.

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