From af1d5d166f72f42ba5a7c8c37dc500aebc79520f Mon Sep 17 00:00:00 2001 From: Smirnov Oleksandr Date: Sat, 15 Jun 2024 12:37:15 +0300 Subject: [PATCH] add deprecation message (#67) --- README.md | 2 ++ lua/gopher/dap.lua | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f105a58..d256e5f 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,8 @@ require("gopher").setup { Setup nvim-dap for go in one line + THIS FEATURE WILL BE REMOVED IN `0.1.6` + note [nvim-dap](https://github.com/mfussenegger/nvim-dap) has to be installed ```lua diff --git a/lua/gopher/dap.lua b/lua/gopher/dap.lua index 6ff326a..9930318 100644 --- a/lua/gopher/dap.lua +++ b/lua/gopher/dap.lua @@ -3,7 +3,6 @@ ---@text This module sets up `nvim-dap` for Go. ---@usage just call `require("gopher.dap").setup()`, and you're good to go. -local u = require "gopher._utils" local c = require "gopher.config" local dap = {} @@ -113,7 +112,15 @@ dap.configuration = { -- sets ups nvim-dap for Go in one function call. function dap.setup() - local d = u.sreq "dap" + vim.deprecate( + "gopher.dap", + "you might consider setting up `nvim-dap` manually, or using another plugin(https://github.com/leoluz/nvim-dap-go)", + "v0.1.6", + "gopher" + ) + + local ok, d = pcall(require, "dap") + assert(ok, "gopher.nvim dependency error: dap not installed") d.adapters.go = dap.adapter d.configurations.go = dap.configuration