nvim-telescope / telescope-ui-select.nvim

MIT License
837 stars 19 forks source link

i do not understand what functionality telescope-ui-select is adding? vim.lsp.buf.document_symbol not working #53

Open mairs8 opened 1 month ago

mairs8 commented 1 month ago

I thought it would add telescope as the default picker for a bunch of neovim core api. As per plugin description in the readme "It sets vim.ui.select to telescope. That means for example that neovim core stuff can fill the telescope picker. Example would be lua vim.lsp.buf.code_action(). "

https://github.com/nvim-telescope/telescope-ui-select.nvim

So for instance when i call vim.lsp.buf.document_symbol it would open up the document symbols with telescope, similar to command Telescope lsp_documents_symbols. However when i do this, it just opens up in the default buffer view like below.

Is there something i am missing?

image

image

require('telescope').setup({
    defaults = {
        -- the following mappings help to avoid using arrows keys and moving into preview pane.
        mappings = {
            i = {
                ["<Tab>"] = focus_preview,       -- focus cursor on preview pane
                ['<C-u>'] = actions.results_scrolling_up, -- navigate results with hjkl (large up)
                ['<C-d>'] = actions.results_scrolling_down, -- navigate results with hjkl (large down)
                ['<C-j>'] = actions.move_selection_next, -- navigate results with hjkl (up one)
                ['<C-k>'] = actions.move_selection_previous, -- navigate results with hjkl (down one)
            },
        },
    },

    extensions = {
        fzf = {
            fuzzy = true,          -- false will only do exact matching
            override_generic_sorter = true, -- override the generic sorter
            override_file_sorter = true, -- override the file sorter
            case_mode = "smart_case", -- or "ignore_case" or "respect_case"
            -- the default case_mode is "smart_case"
        },

        ["ui-select"] = {
            require("telescope.themes").get_dropdown {

            }
        },
    },

    pickers = {
        find_files = {
            mappings = {
                n = {
                    ["cd"] = function(prompt_bufnr)
                        local selection = require("telescope.actions.state").get_selected_entry()
                        local dir = vim.fn.fnamemodify(selection.path, ":p:h")
                        require("telescope.actions").close(prompt_bufnr)
                        -- Depending on what you want put `cd`, `lcd`, `tcd`
                        vim.cmd(string.format("silent lcd %s", dir))
                    end
                }
            }
        },
    },

})

-- To get ui-select loaded and working with telescope, you need to call
-- load_extension, somewhere after setup function:
require("telescope").load_extension("ui-select")
require('telescope').load_extension('fzf')
fe2-Nyxar commented 2 days ago

I'm having troubles setting it up too, just this instead: dressing.nvim