diff --git a/CHANGELOG.md b/CHANGELOG.md index 18ca888b..6e7813c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.3.3] - 2023-10-31 +- Default rust-analyzer configuration [[#37](https://github.com/mrcjkb/rustaceanvim/issues/37)]. + Thanks again, [@eero-lehtinen](https://github.com/eero-lehtinen)! + +## Fixed ## [3.3.2] - 2023-10-31 ## Fixed -- Cargo workspace reload using removed command [[#36]](https://github.com/mrcjkb/rustaceanvim/pull/36). +- Cargo workspace reload using removed command [[#36](https://github.com/mrcjkb/rustaceanvim/pull/36)]. Thanks [@eero-lehtinen](https://github.com/eero-lehtinen)! ## [3.3.1] - 2023-10-31 diff --git a/lua/rustaceanvim/config/check.lua b/lua/rustaceanvim/config/check.lua index 245e0f84..eecc27c9 100644 --- a/lua/rustaceanvim/config/check.lua +++ b/lua/rustaceanvim/config/check.lua @@ -61,11 +61,19 @@ function M.validate(cfg) ok, err = validate('server', { cmd = { server.cmd, { 'function', 'table' } }, standalone = { server.standalone, 'boolean' }, - ['rust-analyzer'] = { server['rust-analyzer'], 'table', true }, + settings = { server.settings, 'table', true }, }) if not ok then return false, err end + if server.settings then + ok, err = validate('server.settings', { + ['rust-analyzer'] = { server.settings['rust-analyzer'], 'table', true }, + }) + if not ok then + return false, err + end + end local dap = cfg.dap local adapter = dap.adapter ok, err = validate('dap.adapter', { diff --git a/lua/rustaceanvim/config/internal.lua b/lua/rustaceanvim/config/internal.lua index aa167da5..fc20a8fc 100644 --- a/lua/rustaceanvim/config/internal.lua +++ b/lua/rustaceanvim/config/internal.lua @@ -169,10 +169,13 @@ local RustaceanDefaultConfig = { ---@type boolean standalone = true, - --- options to send to rust-analyzer - --- See: https://rust-analyzer.github.io/manual.html#configuration --- @type table - ['rust-analyzer'] = {}, + settings = { + --- options to send to rust-analyzer + --- See: https://rust-analyzer.github.io/manual.html#configuration + --- @type table + ['rust-analyzer'] = {}, + }, }, --- debugging stuff