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.86k stars 3.15k forks source link

Inlay Hints are automatically disabled #15909

Open user0608 opened 3 months ago

user0608 commented 3 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

When opening the settings and saving with Ctrl + S, the Inlay Hints are automatically disabled

Environment

ZED: Zed 0.146.5 OS: Ubuntu 22.04.4 LTS x86_64 Kernel: 6.5.0-35-generic DE: GNOME 42.9 CPU: 11th Gen Intel i5-1135G7 (8) @ 4.200GHz GPU: Intel TigerLake-LP GT2 [Iris Xe Graphics] Memory: 12041MiB / 15782MiB

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

Screencast from 08-07-2024 09:09:25 AM.webm

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

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

JosephTLyons commented 3 months ago

Hey @user0608, yeah, this is kind of a weird thing. We have some settings for inlay hints:

"inlay_hints": {
    // Global switch to toggle hints on and off, switched off by default.
    "enabled": false,
    // Toggle certain types of hints on and off, all switched on by default.
    "show_type_hints": true,
    "show_parameter_hints": true,
    // Corresponds to null/None LSP hint type value.
    "show_other_hints": true,
    // Time to wait after editing the buffer, before requesting the hints,
    // set to 0 to disable debouncing.
    "edit_debounce_ms": 700,
    // Time to wait after scrolling the buffer, before requesting the hints,
    // set to 0 to disable debouncing.
    "scroll_debounce_ms": 50
}

The important one is

"inlay_hints": {
    // Global switch to toggle hints on and off, switched off by default.
    "enabled": false,
}

If you set this, the inlay hints should persist. What is happening is that the toggle in your video does not interact with the setting, it is sort of a temporary toggle, for the current file, and then resaving the settings (which includes the default setting for inlay hints when it isn't set (disabled)) turns them back off again. We probably should be persisting this setting, whenever it is changed through the UI button, somehow - that behavior is confusing.