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
34.47k stars 1.71k forks source link

Zed simply ignore the Go language convention #11416

Closed skhaz closed 1 week ago

skhaz commented 1 week ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Create a go file with something similar to:

err = h.DB.QueryRow("SELECT id, ready FROM data WHERE url = ? LIMIT 1", payload.Url).Scan(&id, &ready); if err != nil {

Watch Zed simply ignore the Go language convention and move the if err != nil to a new line, which is wrong!

VSCode does not do that.

Environment

Zed: v0.133.7 (Zed) OS: macOS 14.4.1 Memory: 16 GiB Architecture: aarch64

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

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

htor commented 1 week ago

Does this have anything to do with the maximum line length in your settings perhaps? I would assume Zed is using the one and only standard Go formatter.

skhaz commented 1 week ago

It was my mistake, the line should be

if err = h.DB.QueryRow("SELECT id, error, ready FROM data WHERE url = ? LIMIT 1", payload.Url).Scan(&id, &error, &ready); err != nil {