-
-
Notifications
You must be signed in to change notification settings - Fork 38
nvim-cmp
completions for crates don't show up
#85
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
Comments
This is a minimal config that you can use with local root = vim.fn.fnamemodify("crates_issue", ":p")
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy.nvim
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
require("lazy").setup({
{
"saecki/crates.nvim",
dependencies = "nvim-lua/plenary.nvim",
config = function()
require("crates").setup({
null_ls = {
enabled = true,
},
-- add crates.nvim config that is _necessary_ for reproducing the ISSUE
})
end,
},
{
"hrsh7th/nvim-cmp",
config = function()
require("cmp").setup({
sources = {
{ name = "crates" },
},
-- add nvim-cmp config that is _necessary_ for reproducing the ISSUE
})
end,
},
{
"jose-elias-alvarez/null-ls.nvim",
config = function()
require("null-ls").setup({
null_ls = {
enabled = true,
},
-- add crates.nvim config that is _necessary_ for reproducing the ISSUE
})
end,
},
}, {
root = root .. "/plugins",
})
-- add init.lua settings that are _necessary_ for reproducing the ISSUE I will probably add that later to the bug report form. Can you try to create a minimal reproducible example |
I am currently attempting to find the minimal repro, but with no success so far. |
Okay, the reproduction path has to do with running I'm not sure if it's sth that could be easily fixed in local root = vim.fn.fnamemodify("crates_issue", ":p")
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy.nvim
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
require("lazy").setup({
{
"saecki/crates.nvim",
dependencies = "nvim-lua/plenary.nvim",
config = function()
require("crates").setup({
null_ls = {
enabled = true,
},
-- add crates.nvim config that is _necessary_ for reproducing the ISSUE
})
end,
},
{
"hrsh7th/nvim-cmp",
-- CONFIG COMMENTED OUT FOR REPRODUCTION
-- config = function()
-- local cmp = require("cmp")
-- cmp.setup({
-- mapping = cmp.mapping.preset.insert {},
-- sources = {
-- { name = "crates" },
-- },
-- -- add nvim-cmp config that is _necessary_ for reproducing the ISSUE
-- })
-- end,
},
{
"jose-elias-alvarez/null-ls.nvim",
config = function()
require("null-ls").setup({
null_ls = {
enabled = true,
},
-- add crates.nvim config that is _necessary_ for reproducing the ISSUE
})
end,
},
}, {
root = root .. "/plugins",
})
-- add init.lua settings that are _necessary_ for reproducing the ISSUE
local cmp = require 'cmp'
cmp.setup {
sources = {
{ name = 'crates' }
}
} |
Thank you! |
Hi @saecki, I'm encountering the same issue after I added an event for the cmp plugin. Below is the minimal configuration required for reproduction.
|
require("crates.src.cmp").setup() You could do that inside your |
Current behavior
Completion menu for a crate version field doesn't show crate versions.
Expected behavior
crates
completions should show up.Additional context/Screenshots
crates
is configured as a source in mynvim-cmp
:Verified for
crates.nvim
versions 0.3, 0.4Possible solution
Neovim version
nvim --version
0.9.2
The text was updated successfully, but these errors were encountered: