zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.7k stars 3.14k forks source link

Fomatting on save still happens when disabled #20024

Open 0x5b62656e5d opened 3 weeks ago

0x5b62656e5d commented 3 weeks ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Even though "format on save" is disabled in user settings, saving a file in a remote environment still formats the file.

  1. Disable formatting on save in user settings ("format_on_save": "off")
  2. Connect to remote/ssh
  3. Create a JS file
  4. Add some poorly indented code (or "unformatted" code)
  5. Save file

Environment

Macbook Pro M3, Sequoia 15.1 Remote host: Raspberry Pi 4B, Debian GNU/Linux 12 (Bookworm)

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log


0x5b62656e5d commented 3 weeks ago

Zed.log Was not able to upload log when submitting the issue for some reason

exe-dealer commented 2 weeks ago

in my case it helped to set "format_on_save": "off" in server settings file

0x5b62656e5d commented 2 weeks ago

Even if I don't have a server settings file, it still should not format on save no? Based on local user settings?

jameskozlowskimb commented 2 weeks ago

I have run into the same issue when there is no config file on the remote. If I copy my config to the remote system then it works correctly. I would expect to not need to do this

ConradIrwin commented 2 weeks ago

Hmm. We should fix this. At one point we used to sync all your local settings to the remote, but that caused problems for people who have language-server specific configuration.

I think we need to figure out which settings need to be synced more granularly and upload those; probably all formatting related things (like indent size, etc.); Also allow_binary_downloads when we ship that.

Any others that are top of mind?

exe-dealer commented 1 week ago

I think that root problem in case of 'format_on_save' is that it is 'on' by default. It corrupted all my uncomitted changes when i decided to try zed editor on my pet project.

jameskozlowskimb commented 1 week ago

Hmm. We should fix this. At one point we used to sync all your local settings to the remote, but that caused problems for people who have language-server specific configuration.

I think we need to figure out which settings need to be synced more granularly and upload those; probably all formatting related things (like indent size, etc.); Also allow_binary_downloads when we ship that.

Any others that are top of mind?

As there is the option to have a remote config file and a local one, I would expect it to respect the local one (even if it breaks things) unless I specifically make one on the remote system. That would be the more expected behaviour to me anyway.