Skip to content

Latest commit

 

History

History
59 lines (46 loc) · 1.18 KB

rust.md

File metadata and controls

59 lines (46 loc) · 1.18 KB

Rust

Inlay Hints

The following configuration can be used to enable inlay hints for rust:

"inlayHints": {
  "maxLength": null,
  "lifetimeElisionHints": {
  "useParameterNames": true,
    "enable": "skip_trivial"
  },
  "closureReturnTypeHints": {
    "enable": "always"
  }
}

to make the language server send back inlay hints when Zed has them enabled in the settings.

Use

"lsp": {
  "$LANGUAGE_SERVER_NAME": {
    "initialization_options": {
      ....
    }
  }
}

to override these settings.

See https://rust-analyzer.github.io/manual.html#inlay-hints for more information.

Target directory

The rust-analyzer target directory can be set in initialization_options:

{
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "rust": {
          "analyzerTargetDir": true
        }
      }
    }
  }
}

A true setting will set the target directory to target/rust-analyzer. You can set a custom directory with a string like "target/analyzer" instead of true.