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

Latest version gives "Ignoring invalid config key 'src'" error upon load or fresh install #125

Closed
youwen5 opened this issue May 13, 2024 · 6 comments
Labels
question Further information is requested

Comments

@youwen5
Copy link

youwen5 commented May 13, 2024

Description

image

This error message "Ignoring invalid config key src" pops up as soon as the plugin is loaded, in any projects, even those which do not contain any Rust or Cargo.toml.

Neovim version

NVIM v0.9.5 | Build type: Release | LuaJIT 2.1.1693350652

Health check

============================================================================== crates: require("crates.health").check() Checking plugins ~ - OK null-ls.nvim installed Checking external dependencies ~ - OK curl installed - OK xdg-open installed

Operating system and version

Arch Linux x86_64, Kernel 6.6.30-1-lts

Expected behavior

Plugin loads/installs normally with no issues.

Actual behavior

On Neovim installations where crates.nvim was already installed and was just updated to the latest commit (cfd14e7), the aforementioned error will be emitted. On fresh installations (such as loading the minimal.lua config), the same error will be displayed, but at install time instead of as a notification.

image

This error does not occur in the previous commit (7d8541e).

Minimal config

-- comment out, and add the things that are _necessary_ for reproducing the ISSUE
for name, url in pairs({
    crates = "https://github.com/saecki/crates.nvim",
    plenary = "https://github.com/nvim-lua/plenary.nvim",
    -- cmp = "https://github.com/hrsh7th/nvim-cmp",
    -- coq = "https://github.com/ms-jpq/coq_nvim",
    -- null_ls = "https://github.com/jose-elias-alvarez/null-ls.nvim",
}) do
    local install_path = vim.fn.fnamemodify("crates_issue/" .. name, ":p")
    if vim.fn.isdirectory(install_path) == 0 then
        vim.notify("cloning " .. url .. " into " .. install_path)
        vim.fn.system({ "git", "clone", "--depth=1", url, install_path })
    end
    vim.opt.runtimepath:append(install_path)
end

require("crates").setup({
    src = {
        -- cmp = { enabled = true },
        -- coq = { enabled = true },
    },
    -- null_ls = { enabled = true },
})

-- require("cmp").setup({
-- 	sources = { { name = "crates" } },
-- })

-- require("null-ls").setup({
-- 	on_attach = function(client, buf)
-- 		vim.keymap.set("n", "<space>a", vim.lsp.buf.code_action, { buffer = buf })
-- 	end,
-- })

Cargo.toml

None, this error appears as long as Neovim is opened and the plugin is loaded, even when there is no Cargo.toml

Steps to reproduce

  1. nvim --clean -u minimal.lua
  2. Error will occur.
@youwen5 youwen5 added the bug Something isn't working label May 13, 2024
@saecki
Copy link
Owner

saecki commented May 13, 2024

Yeah sorry, I forgot to mark #120 as a breaking change, src was renamed to completion. #89 shows the breaking changes on main.

If you want to avoid breaking changes in future updates, you should use the stable or a specific release tag as shown in the readme.

@saecki saecki closed this as completed May 13, 2024
@saecki saecki added question Further information is requested and removed bug Something isn't working labels May 13, 2024
@saecki saecki reopened this May 13, 2024
@santoso-wijaya
Copy link

I downgraded to stable and I am seeing this, instead:

Screenshot 2024-05-15 at 7 23 10 AM

My LazyVim config:

return {
  "Saecki/crates.nvim",
  tag = "stable",
}

@saecki
Copy link
Owner

saecki commented May 14, 2024

That's because it doesn't exist on stable: https://github.com/Saecki/crates.nvim/wiki/Documentation-v0.4.0

@saecki saecki closed this as completed May 14, 2024
@santoso-wijaya
Copy link

@saecki Upgrading back to latest, I get this still:

Screenshot 2024-05-15 at 7 43 10 AM

@saecki
Copy link
Owner

saecki commented May 14, 2024

src was renamed to completion. #89 shows the breaking changes on main.

@santoso-wijaya
Copy link

If I understand how LazyVim plugins system works correctly, isn't that what they did (that I made explicit) with:

opts = {
  completion = ...
}

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

No branches or pull requests

3 participants