From cf0ba61cbcc5dcfafee080e1426ec655d1ff16ed Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 5 Aug 2024 20:40:37 +0200 Subject: [PATCH] fix(health): warn if no debug adapters have been detected --- CHANGELOG.md | 6 ++++++ lua/rustaceanvim/health.lua | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b280005e..e61493d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ 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). +## [5.1.5] - 2024-08-05 + +### Fixed + +- Health: Warn if no debug adapters have been detected. + ## [5.1.4] - 2024-08-02 ### Fixed diff --git a/lua/rustaceanvim/health.lua b/lua/rustaceanvim/health.lua index 9086c026..584f0a45 100644 --- a/lua/rustaceanvim/health.lua +++ b/lua/rustaceanvim/health.lua @@ -126,6 +126,15 @@ local function check_config(config) end end +local function is_dap_enabled() + if not pcall(require, 'dap') then + return false + end + local rustaceanvim = vim.g.rustaceanvim or {} + local opts = type(rustaceanvim) == 'function' and rustaceanvim() or rustaceanvim + return vim.tbl_get(opts, 'dap', 'adapter') ~= false +end + local function check_for_conflicts() start('Checking for conflicting plugins') require('rustaceanvim.config.check').check_for_lspconfig_conflict(error) @@ -271,6 +280,9 @@ function health.check() ]], }) end + if adapter == false and is_dap_enabled() then + warn('No debug adapter detected. Make sure either lldb or codelldb is available on the path.') + end for _, dep in ipairs(external_dependencies) do check_external_dependency(dep) end