Skip to content

Commit

Permalink
add deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
olexsmir committed Jun 15, 2024
1 parent fbf6441 commit d9393a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ require("gopher").setup {
<b>Setup <a href="https://github.com/mfussenegger/nvim-dap">nvim-dap</a> for go in one line</b>
</summary>

THIS FEATURE WILL BE REMOVED IN `0.1.6`

note [nvim-dap](https://github.com/mfussenegger/nvim-dap) has to be installed

```lua
Expand Down
11 changes: 9 additions & 2 deletions lua/gopher/dap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d9393a4

Please sign in to comment.