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.3k stars 58 forks source link

neodev change broke detection of plugins #238

Closed blob42 closed 1 year ago

blob42 commented 2 years ago

I upgraded to neodev as well as the latest navigator.lua and guihua. Since #237 the the library is not anymore detecting any plugin. I tried multiple commit versions of neodev up to 10 days ago.

After starting lsp and checking the lua config using vim.lsp.get_active_clients() I only see the default lua workspaces.

Is there a special order I need to consider of installing neodev with Packer ?

UPDATE: After reading this neodev issue it looks like neodev config is getting overriden by the custom sumneko_lua from navigator.

I tried adding a return right after this line and now it looks like it works fine. It is detecting all the plugins as it should.

This is just a hack though as it bypasses the default sumneko_lua conf totally, it has something to do with calling neodev.setup() before the setup from lspconfig

EDIT2: Through a bit of logging, I can confirm that the lspconfig setup is called before neodev setup, however neodev now requires to be setup before lspconfig. I don't have time to do a PR but should be a simple fix

My configs:

navigator

    ["neodev"] = {
      library = {
        enabled = true,
        runtime = true,
        plugins = true,
        -- plugins = {"plenary.nvim"},
        -- plugins = {"navigator.lua", "guihua.lua", "go.nvim", "plenary.nvim"},
        types = true,
      },
      setup_jsonls = true,
    },

packer relevant sections

    ["neovim/nvim-lspconfig"] = { -- {{{
        after = { "neodev.nvim", "mason.nvim", "mason-lspconfig.nvim" },
        module = { "lspconfig" },
        lock = false,
        config = function()
            require("plugins.configs.lspconfig").setup()
        end
    },

    ["ray-x/navigator.lua"] = {
        lock = false,
        opt = true,
        module = "navigator",
        after = { "nvim-lspconfig", "base46", "ui", "mason.nvim", "mason-lspconfig.nvim", "neodev.nvim" },
        requires = { "neovim/nvim-lspconfig", "ray-x/guihua.lua", "nvim-treesitter/nvim-treesitter" },
        setup = function()
            require("core.lazy_load").on_file_open "navigator.lua"
            require("core.utils").load_mappings "navigator"
        end,
        config = function()
            require("custom.plugins.configs.navigator").setup()
            require("base46").load_highlight "lsp"

            -- TODO: use nvchadui_lsp features manually
            -- require("nvchad_ui.lsp")
        end
    },

    ["folke/neodev.nvim"] = {
        commit = "d6212c1" --tested until latest commit, none works
        -- module = "neodev",
    },

nvim version: NVIM v0.9.0-dev-124-gbd7ca10fd

ray-x commented 2 years ago

Thanks, I pushed a fix for that

ray-x commented 1 year ago

Note: I deprecated neodev as the setup is easy with neodev.setup{} There is no needs to call neodev inside navigator.