plugins.rustaceanvim.settings.server.auto_attach

Whether to automatically attach the LSP client. Defaults to true if the rust-analyzer executable is found.

This can also be the definition of a function (fun():boolean).

Plugin default:

  function(bufnr)
    if #vim.bo[bufnr].buftype > 0 then
      return false
    end
    local path = vim.api.nvim_buf_get_name(bufnr)
    if not os.is_valid_file_path(path) then
      return false
    end
    local cmd = types.evaluate(RustaceanConfig.server.cmd)
    ---@cast cmd string[]
    local rs_bin = cmd[1]
    return vim.fn.executable(rs_bin) == 1
  end

Type: null or lua function string or boolean

Default: null

Declared by:

plugins.rustaceanvim.settings.server.cmd

Command and arguments for starting rust-analyzer.

This can also be the definition of a function: fun(project_root:string|nil,default_settings:table):table

Plugin default:

  function()
    return { 'rust-analyzer', '--log-file', RustaceanConfig.server.logfile }
  end

Type: null or lua function string or list of string

Default: null

Declared by:

plugins.rustaceanvim.settings.server.load_vscode_settings

Whether to search (upward from the buffer) for rust-analyzer settings in .vscode/settings json. If found, loaded settings will override configured options.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.rustaceanvim.settings.server.logfile

The path to the rust-analyzer log file.

Type: null or string or raw lua code

Default: null

Plugin default:

{
  __raw = "vim.fn.tempname() .. '-rust-analyzer.log'";
}

Declared by:

plugins.rustaceanvim.settings.server.on_attach

Function to call on attach. If plugins.lsp is enabled, it defaults to the Nixvim global __lspOnAttach function. Otherwise it defaults to null.

Type: null or lua code string

Default: null

Declared by:

plugins.rustaceanvim.settings.server.standalone

Standalone file support (enabled by default). Disabling it may improve rust-analyzer’s startup time.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by: