Skip to content

Commit

Permalink
fix(telescope): deprecation warning for old telescope provider
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 30, 2024
1 parent c68c915 commit 0d7cdeb
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions lua/trouble/providers/telescope.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
local T = require("trouble.sources.telescope")

return {
open_with_trouble = T.open,
open_selected_with_trouble = T.open,
smart_open_with_trouble = T.open,
}
return setmetatable({}, {
__index = function(_, k)
require("trouble.util").warn(
([[
`%s()` is deprecated
```lua
-- Use this:
require("trouble.sources.telescope").open()
-- Instead of:
require("trouble.providers.telescope").%s()
]]):format(k, k),
{ once = true }
)
return T.open
end,
})

0 comments on commit 0d7cdeb

Please sign in to comment.