Skip to content

Commit 23e59fd

Browse files
committed
docs(#3088): mark deprecated api modules, use proper namespacing for deprecateds
1 parent 86f0d81 commit 23e59fd

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
---@meta
2-
32
-- Deprecated top level API modules.
43
-- Remember to add mappings in legacy.lua `api_map`
54

6-
local M = {}
5+
local nvim_tree = { api = {} }
76

8-
M.config = {}
7+
nvim_tree.api.config = {}
98

10-
M.config.mappings = {}
9+
nvim_tree.api.config.mappings = {}
1110

1211
---@deprecated use `nvim_tree.api.map.keymap.current()`
13-
function M.config.mappings.get_keymap() end
12+
function nvim_tree.api.config.mappings.get_keymap() end
1413

1514
---@deprecated use `nvim_tree.api.map.keymap.default()`
16-
function M.config.mappings.get_keymap_default() end
15+
function nvim_tree.api.config.mappings.get_keymap_default() end
1716

1817
---@deprecated use `nvim_tree.api.map.on_attach.default()`
19-
function M.config.mappings.default_on_attach(bufnr) end
18+
function nvim_tree.api.config.mappings.default_on_attach(bufnr) end
2019

21-
M.live_filter = {}
20+
nvim_tree.api.live_filter = {}
2221

2322
---@deprecated use `nvim_tree.api.filter.live.start()`
24-
function M.live_filter.start() end
23+
function nvim_tree.api.live_filter.start() end
2524

2625
---@deprecated use `nvim_tree.api.filter.live.clear()`
27-
function M.live_filter.clear() end
26+
function nvim_tree.api.live_filter.clear() end
2827

29-
M.diagnostics = {}
28+
nvim_tree.api.diagnostics = {}
3029

3130
---@deprecated use `nvim_tree.api.health.hi_test()`
32-
function M.diagnostics.hi_test() end
31+
function nvim_tree.api.diagnostics.hi_test() end
3332

34-
return M
33+
return nvim_tree.api

lua/nvim-tree/_meta/api/tree.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,5 +250,4 @@ function nvim_tree.api.tree.toggle_hidden_filter() end
250250
---@deprecated use `nvim_tree.api.filter.no_bookmark.toggle()`
251251
function nvim_tree.api.tree.toggle_no_bookmark_filter() end
252252

253-
254253
return nvim_tree.api.tree

lua/nvim-tree/api.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,26 @@
7272
--
7373
-- Load the (empty) meta definitions
7474
--
75+
local deprecated = require("nvim-tree._meta.api.deprecated")
7576

7677
---nvim-tree Public API
7778
---@class nvim_tree.api
7879
---@nodoc
7980
local api = {
8081
commands = require("nvim-tree._meta.api.commands"),
81-
config = require("nvim-tree._meta.api.deprecated").config,
82-
diagnostics = require("nvim-tree._meta.api.deprecated").diagnostics,
8382
events = require("nvim-tree._meta.api.events"),
8483
filter = require("nvim-tree._meta.api.filter"),
8584
fs = require("nvim-tree._meta.api.fs"),
8685
git = require("nvim-tree._meta.api._git"),
8786
health = require("nvim-tree._meta.api.health"),
88-
live_filter = require("nvim-tree._meta.api.deprecated").live_filter,
8987
map = require("nvim-tree._meta.api.map"),
9088
marks = require("nvim-tree._meta.api.marks"),
9189
node = require("nvim-tree._meta.api.node"),
9290
tree = require("nvim-tree._meta.api.tree"),
91+
92+
config = deprecated.config, ---@deprecated
93+
diagnostics = deprecated.diagnostics, ---@deprecated
94+
live_filter = deprecated.live_filter, ---@deprecated
9395
}
9496

9597

0 commit comments

Comments
 (0)