diff --git a/doc/telescope.txt b/doc/telescope.txt index 6954475..bab9c5e 100644 --- a/doc/telescope.txt +++ b/doc/telescope.txt @@ -1594,7 +1594,8 @@ builtin.lsp_dynamic_workspace_symbols({opts}) *telescope.builtin.lsp_dynamic_wor Dynamically lists LSP for all workspace symbols - Default keymaps: - ``: show autocompletion menu to prefilter your query by type of - symbol you want to see (i.e. `:variable:`) + symbol you want to see (i.e. `:variable:`), only works after refining + to fuzzy search using Parameters: ~ diff --git a/lua/telescope/actions/init.lua b/lua/telescope/actions/init.lua index 44fc90c..6d3e4f7 100644 --- a/lua/telescope/actions/init.lua +++ b/lua/telescope/actions/init.lua @@ -1274,20 +1274,30 @@ end ---@param prompt_bufnr number: The prompt bufnr actions.to_fuzzy_refine = function(prompt_bufnr) local line = action_state.get_current_line() - local prefix = (function() + local opts = (function() + local opts = { + sorter = conf.generic_sorter {}, + } + local title = action_state.get_current_picker(prompt_bufnr).prompt_title if title == "Live Grep" then - return "Find Word" + opts.prefix = "Find Word" elseif title == "LSP Dynamic Workspace Symbols" then - return "LSP Workspace Symbols" + opts.prefix = "LSP Workspace Symbols" + opts.sorter = conf.prefilter_sorter { + tag = "symbol_type", + sorter = opts.sorter, + } else - return "Fuzzy over" + opts.prefix = "Fuzzy over" end + + return opts end)() require("telescope.actions.generate").refine(prompt_bufnr, { - prompt_title = string.format("%s (%s)", prefix, line), - sorter = conf.generic_sorter {}, + prompt_title = string.format("%s (%s)", opts.prefix, line), + sorter = opts.sorter, }) end diff --git a/lua/telescope/builtin/init.lua b/lua/telescope/builtin/init.lua index bdf7e4c..2f2d5d0 100644 --- a/lua/telescope/builtin/init.lua +++ b/lua/telescope/builtin/init.lua @@ -462,7 +462,7 @@ builtin.lsp_workspace_symbols = require_on_exported_call("telescope.builtin.__ls --- Dynamically lists LSP for all workspace symbols --- - Default keymaps: ---- - ``: show autocompletion menu to prefilter your query by type of symbol you want to see (i.e. `:variable:`) +--- - ``: show autocompletion menu to prefilter your query by type of symbol you want to see (i.e. `:variable:`), only works after refining to fuzzy search using ---@param opts table: options to pass to the picker ---@field fname_width number: defines the width of the filename section (default: 30) ---@field show_line boolean: if true, shows the content of the line the symbol is found on (default: false)