Skip to content

Commit baf06e9

Browse files
committed
Removed inherited telescope options to make it simpler
Removed entry_maker and path_display. I'll add them later if I need to
1 parent 5188fa4 commit baf06e9

3 files changed

Lines changed: 4 additions & 15 deletions

File tree

doc/clapi.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ When the picker opens, you can:
9797
The clapi picker accepts the following options:
9898

9999
- `bufnr`: Buffer number (defaults to current buffer)
100-
- `path_display`: How to display paths
101-
- `entry_maker`: Custom entry maker function
102100
- `show_inherited`: Whether to show inherited members from parent classes,
103101
traits, and interfaces (defaults to true)
104102
- `visibility`: Filter members by visibility: "public", "protected", "private",
@@ -132,8 +130,6 @@ Opens the telescope picker with module interface.
132130
Parameters:
133131
- `opts` (table, optional): Configuration options
134132
- `bufnr` (number, optional): Buffer number, defaults to current buffer (0)
135-
- `path_display` (table|string, optional): How to display paths
136-
- `entry_maker` (function, optional): Custom entry maker function
137133
- `show_inherited` (boolean, optional): Show inherited members from parent classes,
138134
traits, and interfaces. Defaults to true. Set to false to only show members
139135
defined in the current class.
@@ -161,7 +157,6 @@ Basic usage: >lua
161157
Advanced usage with custom options: >lua
162158
-- Open the API picker with specific options
163159
require('clapi').builtin({
164-
path_display = { "smart" },
165160
show_inherited = false, -- Only show members defined in the current class
166161
visibility = "public" -- Only show public members
167162
})

lua/clapi/finder.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@ local M = {}
1111
---Build and display a telescope picker with module interface
1212
---@param opts? table Configuration options
1313
---@param opts.bufnr? integer Buffer number, defaults to current buffer (0)
14-
---@param opts.path_display? table|string How to display paths
15-
---@param opts.entry_maker? function Custom entry maker function
1614
---@param opts.show_inherited? boolean Show inherited members, defaults to true
1715
---@param opts.visibility? string Filter by visibility (public, protected, private), defaults to nil (all)
1816
---@return nil
1917
M.builtin = function(opts)
2018
-- vim.print(opts)
2119
opts = opts or {}
2220
opts.bufnr = opts.bufnr or 0
23-
opts.path_display = { "smart" }
2421

2522
async.run(function()
2623
local results = parser.parse_file(opts)
@@ -34,7 +31,7 @@ M.builtin = function(opts)
3431
prompt_title = "Module Interface",
3532
finder = finders.new_table({
3633
results = results,
37-
entry_maker = opts.entry_maker or make_entry.gen_from_lsp_symbols(opts),
34+
entry_maker = make_entry.gen_from_lsp_symbols(opts),
3835
}),
3936
previewer = telescope_config.qflist_previewer(opts),
4037
sorter = telescope_config.prefilter_sorter({
@@ -48,4 +45,4 @@ M.builtin = function(opts)
4845
end)
4946
end
5047

51-
return M
48+
return M

tests/clapi/unit/make_entry_spec.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ describe("gen_from_lsp_symbols", function()
55
-- Setup mock data
66
local opts = {
77
bufnr = 1,
8-
path_display = { "hidden" },
98
}
109

1110
-- Mock vim.api functions
@@ -54,7 +53,6 @@ describe("gen_from_lsp_symbols", function()
5453
-- Setup mock data
5554
local opts = {
5655
bufnr = 1,
57-
path_display = { "hidden" },
5856
}
5957

6058
-- Mock vim.api functions
@@ -93,11 +91,10 @@ describe("gen_from_lsp_symbols", function()
9391
vim.api.nvim_buf_get_name = original_buf_get_name
9492
end)
9593

96-
it("should handle path display correctly", function()
97-
-- Setup mock data with visible paths
94+
it("should handle filename display correctly", function()
95+
-- Setup mock data
9896
local opts = {
9997
bufnr = 1,
100-
path_display = { "smart" }, -- Not "hidden"
10198
}
10299

103100
-- Mock vim.api functions

0 commit comments

Comments
 (0)