Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mairs8 opened this issue Oct 19, 2024 · 1 comment

Comments

@mairs8
Copy link

mairs8 commented Oct 19, 2024

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants