ray-x / navigator.lua

Code analysis & navigation plugin for Neovim. Navigate codes like a breeze🎐 Exploring LSP and 🌲Treesitter symbols a piece of 🍰 Take control like a boss 🦍
MIT License
1.29k stars 58 forks source link

neovim 0.7.0 duplicates clang #171

Open chriztheanvill opened 2 years ago

chriztheanvill commented 2 years ago

Hi. With the new neovim 0.7.0, duplicates clang:

clangd =  {
    cmd = {
        "clangd",
        -- "clangd",
        "--background-index",
        "--pch-storage=memory",
        "--clang-tidy",
        "--completion-style=detailed",
        -- "--suggest-missing-includes",
        "--all-scopes-completion",
        "--cross-file-rename",
        --"--log=verbose",
        "--pretty",
        "--header-insertion=never",
        "--query-driver=/usr/include/*",
        "-j=2",
        "--enable-config"
    },
    filetypes = { "c", "cpp" },

    on_attach = on_attach,
    capabilities = capabilities,
 }
ray-x commented 2 years ago

the clangd cmd setup :

    cmd = {
      'clangd',
      '--background-index',
      '--suggest-missing-includes',
      '--clang-tidy',
      '--header-insertion=iwyu',
      '--clang-tidy-checks=-*,llvm-*,clang-analyzer-*',
      '--cross-file-rename',
    },

I do not see clangd used twice.

chriztheanvill commented 2 years ago

Try check the :lspInfo

ray-x commented 2 years ago

@chriztheanvill Could you check if it works for you? Looks good to me

image
chriztheanvill commented 2 years ago

Thank you, it helps, but the new version has complains with the key mapping :D

--- This is my config.
keymaps = {
        { key = "<leader>lr", func = "require('navigator.reference').reference()" },
        { mode = "i", key = "<M-k>", func = "signature_help()" },
        { key = "<A-k>", func = "signature_help()" },
        { key = "<leader>ly", func = "require('navigator.symbols').document_symbols()" },
        { key = "<leader>lY", func = "workspace_symbol()" },
        { key = "<c-]>", func = "require('navigator.definition').definition()" },
        { key = "<leader>ld", func = "declaration({ border = 'rounded', max_width = 80 })" },
        { key = "<leader>lp", func = "require('navigator.definition').definition_preview()" },
        { key = "<leader>lT", func = "require('navigator.treesitter').buf_ts()" },
        { key = "<Leader>lt", func = "require('navigator.treesitter').bufs_ts()" },
        { key = "K", func = "hover({ popup_opts = { border = single, max_width = 80 }})" },
        { key = "<leader>lca", mode = "n", func = "require('navigator.codeAction').code_action()" },
        { key = "<leader>lcA", mode = "v", func = "range_code_action()" },
        { key = "<Leader>lRe", func = "rename()" },
        { key = "<leader>lRn", func = "require('navigator.rename').rename()" },
        { key = "<Leader>lCi", func = "incoming_calls()" },
        { key = "<Leader>lCo", func = "outgoing_calls()" },
        { key = "<leader>li", func = "implementation()" },
        { key = "<leader>lD", func = "type_definition()" },
        { key = "<leader>ll", func = "require('navigator.diagnostics').show_diagnostics()" },
        { key = "<leader>lG", func = "require('navigator.diagnostics').show_buf_diagnostics()" },
        { key = "]d", func = "diagnostic.goto_next({ border = 'rounded', max_width = 80})" },
        { key = "[d", func = "diagnostic.goto_prev({ border = 'rounded', max_width = 80})" },
        { key = "]r", func = "require('navigator.treesitter').goto_next_usage()" },
        { key = "[r", func = "require('navigator.treesitter').goto_previous_usage()" },
        { key = "<leader>lf", func = "definition()" },
        -- {key = "g<LeftMouse>", func = "implementation()"},
        { key = "<Leader>lk", func = "require('navigator.dochighlight').hi_symbol()" },
        { key = '<leader>lWa', func = 'add_workspace_folder()' },
        { key = '<leader>lWr', func = 'remove_workspace_folder()' },
        { key = '<leader>lFf', func = 'formatting()', mode = 'n' },
        { key = '<leader>lFf', func = 'range_formatting()', mode = 'v' },
        { key = '<leader>lWl', func = 'print(vim.inspect(vim.lsp.buf.list_workspace_folders()))' },
        { key = "<leader>lcr", mode = "n", func = "require('navigator.codelens').run_action()" },
    }, 
ray-x commented 2 years ago

it quit unfortunate that there is a breaking change You have to use this to override the mappings:

  { key = '<Leader>gr', func = require('navigator.reference').reference, desc = 'reference' }, 

It was metioned here: https://github.com/ray-x/navigator.lua/issues/1#issuecomment-1181201077