zk-org / zk-nvim

Neovim extension for zk
https://github.com/zk-org/zk
GNU General Public License v3.0
530 stars 42 forks source link

LSP go to definition includes top frontmatter fences in Telescope results #185

Closed tjex closed 1 month ago

tjex commented 2 months ago

Check if applicable

Describe the bug

Being tracked at https://github.com/zk-org/zk/issues/447. But also worth posting here. It's not immediately clear if its a zk-nvim issue or zk lsp issue.

How to reproduce?

see above issue link

zk configuration

na

Neovim configuration

na

Environment

zk 0.14.1-12-g0787930
system: Darwin 23.6.0 arm64
NVIM v0.10.0
Build type: Debug
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info
github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in the next 5 days.

tjex commented 1 month ago

The problem was that I needed to also set my keymap for go to definition in zk conf. I only had it set in lsp conf.

Both marksman and zk were reporting back with results for go to definition. But for some reason, when zk didn't have the same keybind set in its on_attach table, the two different results (masons being the heading of the file, and zk's being the first line of the file) would be returned as multiple results, and so Telescope / fzf_lua were being used as my list picker to see which I wanted to go to.

I don't know why now I don't get any multi-select list being presented to me, just because I have the keybind set in zk conf 🤷‍♂️

lsp = {
    config = {
        cmd = { "zk", "lsp", "--log", "/tmp/zk-lsp.log" },
        name = "zk",
        on_attach = function()
            require("cmp_nvim_lsp").default_capabilities()
            key.nmap({ "gd", vim.lsp.buf.definition })
            keymaps()
        end,
    },