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
47.48k stars 2.77k forks source link

Minor Issue - Default Settings - Incorrect types #18006

Open dhunter opened 6 days ago

dhunter commented 6 days ago

Check for existing issues

Describe the bug / provide steps to reproduce it

A few of the Default Settings flags show error underlines, as follows, when copied into active settings.json, (i.e. ~/.config/zed on Linux). Mouseover error text shown after //.

1) Open active settings.json, (Ctrl-,). 2) Open Default Settings, (open Command Palette, enter "zed: open default settings"). 3) Copy Default Settings into active settings.json 4) Save 5) Scroll through merged active settings.json for any error underlines.

Environment

Zed: v0.152.4 (Zed) OS: Linux X11 opensuse-tumbleweed 20240917 Memory: 31.2 GiB Architecture: x86_64 GPU: NVIDIA GeForce GTX 970M || NVIDIA || 550.107.02

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


ZhiaDev commented 6 days ago

Yes, especially the font field. It should have an array of fonts, so that if a character isn't in the first font, it uses the second.

notpeter commented 4 days ago

The defaults for those maybe should be [] but that might require some serde/schemars fiddling to ensure values of []/null and the key being not present have identical behavior (untested).

https://github.com/zed-industries/zed/blob/d6c184b494a0c9a9a46d4ffdb5483ba65967ab0b/crates/theme/src/settings.rs#L262-L265

Alternatively we could comment them out like we inside the terminal block:

https://github.com/zed-industries/zed/blob/d6c184b494a0c9a9a46d4ffdb5483ba65967ab0b/assets/settings/default.json#L731-L734

Thanks for reporting.