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
46.97k stars 2.7k forks source link

Insert explicit type doenst work for some reason #15074

Open caoguojun0 opened 1 month ago

caoguojun0 commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Hi!

I just discovered that I don't have an insert explicit type in code actions, I'm giving you my settings below

"inlay_hints": {
    "enabled": true,
    "show_type_hints": true,
    "show_parameter_hints": false,
    "show_other_hints": true,
    "edit_debounce_ms": 50,
    "scroll_debounce_ms": 50
  },

and the settings of Rust lsp itself

"lsp": {
    "rust-analyzer": {
      "enabled": true,
      "initialization_options": {
        "inlayHints": {
          "typeHints": {
            "enable": true,
            "parameterHints": {
              "enable": true
            },
            "chainingHints": {
              "enable": true
            },
            "closureReturnTypeHints": {
              "enable": "always"
            },
            "lifetimeElisionHints": {
              "enable": "always",
              "useParameterNames": true
            }
          }
        },
        "rust": {
          "analyzerTargetDir": true
        },
        "check": {
          "command": "clippy"
        },
        "rustfmt": {
          "enableRangeFormatting": true
        }
      }
    },

Environment

Zed: v0.144.4 (Zed) OS: macOS 14.1.0 Memory: 48 GiB Architecture: aarch64

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

https://github.com/user-attachments/assets/35340c00-161a-4d45-afe6-6c4b7e027c8a

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

Zed.log


notpeter commented 1 month ago

That code action shows up for me on the zed codebase with the default language settings:

Screenshot 2024-07-28 at 12 58 44

Could you see if this is a project specific issue (e.g. clone the zed repo and see if it works there) or whether it's a settings specific issue (comment out your settings) or something else?