rust_analyzer

URL: https://rust-analyzer.github.io

plugins.lsp.servers.rust_analyzer.enable

Whether to enable https://github.com/rust-lang/rust-analyzer

rust-analyzer (aka rls 2.0), a language server for Rust

See docs for extra settings. The settings can be used like this:

require'lspconfig'.rust_analyzer.setup{
  settings = {
    ['rust-analyzer'] = {
      diagnostics = {
        enable = false;
      }
    }
  }
}

Note: do not set init_options for this LS config, it will be automatically populated by the contents of settings[“rust-analyzer”] per https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26. .

Type: boolean

Default: false

Example: true

Declared by:

plugins.lsp.servers.rust_analyzer.package

The rust_analyzer package to use.

Type: null or package

Default: pkgs.rust-analyzer

Declared by:

plugins.lsp.servers.rust_analyzer.autostart

Controls if the FileType autocommand that launches a language server is created. If false, allows for deferring language servers until manually launched with :LspStart (|lspconfig-commands|).

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.lsp.servers.rust_analyzer.cargoPackage

The cargo package to use.

Type: package

Default: pkgs.cargo

Declared by:

plugins.lsp.servers.rust_analyzer.cmd

A list where each entry corresponds to the blankspace delimited part of the command that launches the server.

The first entry is the binary used to run the language server. Additional entries are passed as arguments.

Type: null or (list of string)

Default: null

Declared by:

plugins.lsp.servers.rust_analyzer.extraOptions

Extra options for the rust_analyzer language server.

Type: attribute set of anything

Default: { }

Declared by:

plugins.lsp.servers.rust_analyzer.filetypes

Set of filetypes for which to attempt to resolve {root_dir}. May be empty, or server may specify a default value.

Type: null or (list of string)

Default: null

Declared by:

plugins.lsp.servers.rust_analyzer.installCargo

Whether to install cargo.

Type: null or boolean

Default: null

Example: true

Declared by:

plugins.lsp.servers.rust_analyzer.installRustc

Whether to install rustc.

Type: null or boolean

Default: null

Example: true

Declared by:

plugins.lsp.servers.rust_analyzer.installRustfmt

Whether to install rustfmt.

Type: null or boolean

Default: null

Example: true

Declared by:

plugins.lsp.servers.rust_analyzer.rootDir

A function (or function handle) which returns the root of the project used to determine if lspconfig should launch a new language server, or attach a previously launched server when you open a new buffer matching the filetype of the server.

Type: null or lua function string

Default: null

Plugin default: "nil"

Declared by:

plugins.lsp.servers.rust_analyzer.rustcPackage

The rustc package to use.

Type: package

Default: pkgs.rustc

Declared by:

plugins.lsp.servers.rust_analyzer.rustfmtPackage

The rustfmt package to use.

Type: package

Default: pkgs.rustfmt

Declared by: