Skip to content

Commit be8d980

Browse files
deleted uneeded stuff
1 parent 068c91b commit be8d980

File tree

2 files changed

+8
-36
lines changed

2 files changed

+8
-36
lines changed

lua/telescope/builtin/lsp.lua

+6-24
Original file line numberDiff line numberDiff line change
@@ -229,51 +229,33 @@ local function get_workspace_symbols_requester()
229229
local cancel = function() end
230230

231231
return async(function(prompt_bufnr, prompt)
232-
-- cancel()
233-
234232
local tx, rx = channel.oneshot()
235233
cancel = vim.lsp.buf_request(prompt_bufnr, "workspace/symbol", {query = prompt}, tx)
236234

237235
local err, _, results_lsp = await(rx())
238236
assert(not err, err)
239-
-- dump(results_lsp)
240-
-- assert(not err, err)
241-
-- dump(await(rx()))
242237

243238
local locations = vim.lsp.util.symbols_to_items(results_lsp, prompt_bufnr) or {}
244-
-- dump(locations)
245-
-- local locations vim.tbl_map(function(result)
246-
-- return
247-
-- end, results_lsp)
248-
-- dump(locations)
249-
-- return locations
250239
return locations
251-
-- local locations = {}
252-
-- for _, server_results in pairs(results_lsp) do
253-
-- if server_results.result then
254-
-- vim.list_extend(locations, vim.lsp.util.symbols_to_items(server_results.result, 0) or {})
255-
-- end
256-
-- end
257-
258-
-- return locations
259240
end)
260241
end
261242

262243
lsp.live_workspace_symbols = function(opts)
263244
local curr_buf = vim.api.nvim_get_current_buf()
264245

265246
pickers.new(opts, {
266-
prompt_title = 'LSP Workspace Symbols',
247+
prompt_title = 'LSP Live Workspace Symbols',
267248
finder = finders.new_live {
268249
curr_buf = curr_buf,
269250
entry_maker = opts.entry_maker or make_entry.gen_from_lsp_symbols(opts),
270251
fn = get_workspace_symbols_requester(),
271252
},
272253
previewer = conf.qflist_previewer(opts),
273-
sorter = conf.prefilter_sorter{
274-
tag = "symbol_type",
275-
sorter = conf.generic_sorter(opts)
276-
}
254+
sorter = conf.generic_sorter()
255+
-- sorter = conf.prefilter_sorter{
256+
-- tag = "symbol_type",
257+
-- sorter = conf.generic_sorter(opts)
258+
-- }
277259
}):find()
278260
end
279261

lua/telescope/finders.lua

+2-12
Original file line numberDiff line numberDiff line change
@@ -117,31 +117,21 @@ function LiveFinder:new(opts)
117117
curr_buf = opts.curr_buf,
118118
fn = opts.fn,
119119
entry_maker = opts.entry_maker or make_entry.from_string,
120-
fn_command = opts.fn_command,
121-
cwd = opts.cwd,
122-
writer = opts.writer,
123-
124-
-- Maximum number of results to process.
125-
-- Particularly useful for live updating large queries.
126-
maximum_results = opts.maximum_results,
127120
}, self)
128121

129122
return obj
130123
end
131124

132125
function LiveFinder:_find(prompt, process_result, process_complete)
133-
local fn = async(function()
126+
a.scope(function()
134127
local results = await(self.fn(self.curr_buf, prompt))
135128
for _, result in ipairs(results) do
136-
dump("processing result", result)
137-
process_result(result)
129+
process_result(self.entry_maker(result))
138130
end
139131

140132
await(a.scheduler())
141133
process_complete()
142134
end)
143-
144-
a.util.run(fn())
145135
end
146136

147137
local OneshotJobFinder = _callable_obj()

0 commit comments

Comments
 (0)