Git Product home page Git Product logo

crates.nvim's Introduction

crates.nvim

CI LOC

A neovim plugin that helps managing crates.io dependencies.

Feel free to open issues.

Screencast.from.2023-03-11.05-29-22.webm

Setup

Installation

To use a stable release.

vim-plug

Plug 'saecki/crates.nvim', { 'tag': 'stable' }

lua require('crates').setup()

lazy.nvim

{
    'saecki/crates.nvim',
    tag = 'stable',
    config = function()
        require('crates').setup()
    end,
}
If you're feeling adventurous and want to use the newest features.

vim-plug

Plug 'saecki/crates.nvim'

lua require('crates').setup()

lazy.nvim

{
    'saecki/crates.nvim',
    config = function()
        require('crates').setup()
    end,
}
For lazy loading.
{
    'saecki/crates.nvim',
    event = { "BufRead Cargo.toml" },
    config = function()
        require('crates').setup()
    end,
}

Related projects

crates.nvim's People

Contributors

aznhe21 avatar dsully avatar elkowar avatar figsoda avatar jamestrew avatar jasonrhansen avatar jwong101 avatar mahor1221 avatar muniftanjim avatar rubixdev avatar saecki avatar ten3roberts avatar thehamsta avatar zmtq05 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

crates.nvim's Issues

cannot resume dead coroutine

Description

I'm not exactly sure what is going on, but here is the error:

Error executing vim.schedule lua callback: .../.local/share/nvim/lazy/crates.nvim/lua/crates/async.lua:8: cannot resume dead coroutine
stack traceback:
stack traceback:
	[C]: in function 'error'
	.../.local/share/nvim/lazy/crates.nvim/lua/crates/async.lua:8: in function 'c'
	...nk/.local/share/nvim/lazy/crates.nvim/lua/crates/api.lua:302: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

I'm using the latest version and I've had to set the max_parallel to 10 as I was getting "EMFILE: too many open files"

Neovim version

NVIM v0.9.4 Build type: Release LuaJIT 2.1.1699180677 system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.4/share/nvim" Run :checkhealth for more info

Operating system and version

MacOS 14.2.1 (23C71)

Expected behavior

No response

Actual behavior

Erroring

Minimal config

return {
  "hrsh7th/nvim-cmp",
  dependencies = {
    {
      "Saecki/crates.nvim",
      event = { "BufRead Cargo.toml" },
      opts = {
        max_parallel_requests = 10,
      },
    },
  },
}

Cargo.toml

[workspace]
members = [
"test"
]
resolver = "2"

[workspace.package]
version = "0.1"
edition = "2021"

[workspace.dependencies]
analytics = { version = "0.2", default-features = false }
anchorhash = { version = "0.2.2", default-features = false, features = [
"fastmod",
"simd",
] }
anyhow = { version = "1", default-features = false, features = ["std"] }
archetype = { version = "0.2.0", default-features = false }
async-channel = { version = "1", default-features = false }
async-compression = { version = "0.4", default-features = false, features = [
"gzip",
"tokio",
] }
async-stripe = { version = "0.25.2", default-features = false, features = [
"runtime-tokio-hyper",
"stream",
"checkout",
"uuid",
"billing",
] }
async-trait = { version = "0.1", default-features = false }
aws-config = { version = "0.55", default-features = false, features = [
"native-tls",
] }
aws-sdk-s3 = { version = "0.27", default-features = false }
aws-sdk-sqs = { version = "0.27", default-features = false }
aws-smithy-http = { version = "0.55", default-features = false, features = [
"rt-tokio",
] }
axum = { version = "0.6", features = ["tokio", "http2"] }
axum-auth = { version = "0.4", features = ["auth-basic"] }
axum-prometheus = { version = "0.4", default-features = false, features = [
"prometheus",
] }
base32 = { version = "0.4", default-features = false }
base64 = { version = "0.21", default-features = false }
bs58 = { version = "0.5.0", default-features = false, features = [
"std",
"alloc",
] }
chrono = { version = "0.4", default-features = false }
clap = { version = "4", default-features = false, features = [
"derive",
"env",
"std",
"help",
] }
clickhouse = { version = "0.11.6", default-features = false, features = [
"lz4",
"time",
"tls",
] }
criterion = { version = "0.5.1", default-features = false, features = [
"async_tokio",
] }
dotenvy = { version = "0.15", default-features = false }
dirs = { version = "5", default-features = false }
flate2 = { version = "1.0.28", default-features = false, features = [
"rust_backend",
] }
futures = { version = "0.3", default-features = false }
fxhash = { version = "0.2", default-features = false }
hyper = { version = "0.14", default-features = false, features = ["http1"] }
hyper-tls = { version = "0.5.0", default-features = false }
jwt-simple = { version = "0.11", default-features = false }
k8s-openapi = { version = "0.19.0", default-features = false, features = [
"v1_24",
"schemars",
] }
kube = { version = "0.85", default-features = false, features = [
"client",
"runtime",
"derive",
"openssl-tls",
] }
lazy_static = { version = "1", default-features = false }
moka = { version = "0.12", default-features = false, features = [
"sync",
"future",
] }
metrics = { version = "0.21", default-features = false }
nanoid = { version = "0.4", default-features = false }
non-empty-string = { version = "0.2", default-features = false }
notify = { version = "6", default-features = false, features = [
"macos_fsevent",
] }
oci-distribution = { version = "0.9", default-features = false, features = [
"native-tls",
] }
once_cell = { version = "1", default-features = false }
pbkdf2 = { version = "0.12.2", default-features = false, features = ["simple"] }
prometheus-http-query = { version = "0.7", default-features = false }
prost = { version = "0.11", default-features = false }
rand = { version = "0.8", default-features = false, features = [
"std",
"std_rng",
] }
rand_core = { version = "0.6", default-features = false, features = ["std"] }
regex = { version = "1", default-features = false }
reqwest = { version = "0.11", default-features = false, features = [
"default-tls",
"json",
] }
rsa-der = { version = "0.3", default-features = false }
schemars = { version = "0.8", default-features = false, features = [
"url",
"chrono",
"derive",
] }
serde = { version = "1", default-features = false, features = [
"std",
"derive",
] }
serde_json = { version = "1.0", default-features = false, features = ["std"] }
serde_yaml = { version = "0.9", default-features = false }
sha2 = { version = "0.10", default-features = false }
smartstring = { version = "1.0.1", features = ["serde"] }
snap = { version = "1.1.1" }
sqlx = { version = "0.6", default-features = false, features = [
"chrono",
"macros",
"migrate",
"offline",
"postgres",
"runtime-tokio-native-tls",
"tls",
"json",
"uuid",
] }
static_assertions = { version = "1.1.0", default-features = false }
tar = { version = "0.4.38", default-features = false }
tempfile = { version = "3", default-features = false }
thiserror = { version = "1", default-features = false }
thingbuf = { version = "0.1.4", default-features = false, features = [
"std",
"static",
] }
time = { version = "0.3.30", features = [
"serde",
"parsing",
"formatting",
"macros",
] }
tokio = { version = "1", default-features = false, features = ["full"] }
tokio-test = { version = "0.4", default-features = false }
tokio-util = { version = "0.7", default-features = false }
toml = { version = "0.8", default-features = false, features = [
"display",
"parse",
] }
tonic = { version = "0.9", features = ["transport", "tls", "tls-roots"] }
tonic-build = { version = "0.9", default-features = false, features = [
"prost",
"transport",
] }
tonic-health = { version = "0.9", default-features = false, features = [
"transport",
] }
tonic-reflection = { version = "0.9", default-features = false }
tracing = { version = "0.1", default-features = false }
tracing-subscriber = { version = "0.3", default-features = false, features = [
"std",
"fmt",
"json",
"env-filter",
"ansi",
] }
tower = { version = "0.4", default-features = false }
tower-http = { version = "0.4", default-features = false, features = [
"fs",
"auth",
"trace",
] }
derive_builder = { version = "0.12.0", default-features = false, features = [
"std",
] }
url = { version = "2.5", default-features = false, features = ["serde"] }
urlencoding = { version = "2.1", default-features = false }
uuid = { version = "1", default-features = false, features = [
"v4",
"fast-rng",
] }
validator = { version = "0.16.1", default-features = false, features = [
"derive",
] }
walkdir = { version = "2", default-features = false }
x509-certificate = { version = "0.21", default-features = false }
zip = { version = "0.6", default-features = false, features = ["deflate"] }

[profile.release]
lto = false
codegen-units = 64

Steps to reproduce

I don't actually know how to setup a minimal configuration. I'm using lazy nvim.

Consider debounce and/or throttle for audo update

Current behavior

The virtual text and diagnostics are updated for each character types, which slows down neovim and contributes to input lag when using autoupdate=true

Expected behavior

The crates are only fetched and updated every x milliseconds when typing, reducing lag

Neovim version

nvim --version
NVIM v0.9.0-dev-636+g53adccb6e                                                                                                                                                                                                                                  
Build type: RelWithDebInfo                                                                                                                                                                                                                                      
LuaJIT 2.1.0-beta3                                                                                                                                                                                                                                              
Compilation: /usr/bin/cc -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attri
bute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/tei/dev/neo
vim/build/cmake.config -I/home/tei/dev/neovim/src -I/home/tei/dev/neovim/.deps/usr/include -I/usr/include -I/home/tei/dev/neovim/build/src/nvim/auto -I/home/tei/dev/neovim/build/include                                                                       
Compiled by tei@fedora                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                
Features: +acl +iconv +tui                                                                                                                                                                                                                                      
See ":help feature-compile"                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                
   system vimrc file: "$VIM/sysinit.vim"                                                                                                                                                                                                                        
  fall-back for $VIM: "/usr/local/share/nvim"                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                
Run :checkhealth for more info                                  

Mixing up underscores/dashes in a crates name yields metadata for the crate - even though its name is for a nonexistent crate

Current behavior

image

(underscore instead of dash yields a tick and version info for the crate with a dash in its name)

Expected behavior

image
(Error fetching crate to show when a crate name has an underscore in it instead of a dash

Additional context/Screenshots

Possible solution

Neovim version

nvim --version
NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by runner@fv-az178-366

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info```
</details>

feature request: close popup on select

Description

Add a close_on_select: bool option for popup windows.

Expected Behaviour

close (or hide) the popup windows automatically once the user picked up (press the <cr> buttom) the wanted version.

ๅ›พ็‰‡

Feature: convert format from string to object

I find myself quite frequently having to turn plugin definitions from their simple format

foo = "1.2.3"

into the verbose form

foo = { version = "1.2.3" }

to then add features or set other properties.
It'd be nice if this plugin had a keybind to switch from one to the other, optimally positioning the cursor after the version field for easy insertion.

Required font?

What font is needed to display the default icons for this plugin? It says a "patched font" in the readme, but I'm not sure which one that might be.

EDIT: oops I accidentally labeled this as bug. This is not a bug but I can't seem to remove the tag.

Lua error

Current behavior

After installation via vim-plug the lua line causes an error.
Error executing string 'crates' module not found.

E5108: Error executing lua [string ":lua"]:1: module 'crates' not found: no field package.preload['crates'] no file './crates.lua' no file '/usr/share/luajit-2.1.0-beta3/crates.lua' no file '/usr/local/share/lua/5.1/crates.lua' no file '/usr/local/share/lua/5.1/crates/init.lua' no file '/usr/share/lua/5.1/crates.lua' no file '/usr/share/lua/5.1/crates/init.lua' no file './crates.so' no file '/usr/local/lib/lua/5.1/crates.so' no file '/usr/lib/x86_64-linux-gnu/lua/5.1/crates.so' no file '/usr/local/lib/lua/5.1/loadall.so' stack traceback: [C]: in function 'require' [string ":lua"]:1: in main chunk

Expected behavior

Expected it to setup

Possible solution

I tried creating a ./crates.lua file and putting in the default config in there but it did not resolve anything. Also tried a few of the other places it searched.
I also tried the neovim 0.8.0 appimage but when that did not work either i reverted back to the one I had installed previously.

Neovim version

NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Mistake in readme

The lazy installation uses use.
(which is packer but also uses dependendencies?)

Opening a cargo.toml directly causes error

I use a plugin to handle sessions and whenever one of those sessions have a Cargo.toml file opened I see the following error:

Error executing vim.schedule lua callback: ...e/nvim/site/pack/packer/start/crates.nvim/lua/crates.lua:83: attempt to index a nil value

If I close the file and open again it works fine, but on nvim opening it is causing this error.

Multiline arrays and features

Current behavior

Features which are in a multi line array are not recognized.

The multiline arrays happen automatically after a certain number of features using lsp-format with taplo, or any other toml formatter or outputter.

Expected behavior

The features on multiline arrays are all parsed and when adding a feature it added to the end of the list rather than at the end of the line without a comma.

Additional context/Screenshots

image image

Neovim version

nvim --version
NVIM v0.10.0-dev-2158+g3d948a4dc-Homebrew
Build type: Release
LuaJIT 2.1.0-beta3
Run "nvim -V1 -v" for more info

Better colored highlighting of updates in the plain text mode

Current behavior

Currently there are no visual cues if there is an minor or major update for particular crates if no icons are enabled (plain text mode).

Expected behavior

It would make sense to use colors to indicate the importance of the update

Additional context/Screenshots

Screenshot 2023-04-06 at 15 12 45

Note that lazy_static didn't warn at all, and there is no indication that there is a major update of serde.

Neovim version

nvim --version
NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.8.3/share/nvim"

Run :checkhealth for more info

Error while processing BufReadPost Autocommands

image

configuration

use {
  'saecki/crates.nvim',  -- crates auto completion
  tag = 'v0.3.0',
  requires = { 'nvim-lua/plenary.nvim' },
  config = function()
    require('crates').setup()
  end,
}

No other place to set up or configure crates.

Netrw opens inside popup if `./crates` is a directory

Current behavior

When doing crates.show_crate_popup() netrw is opened inside the popup window if a directory names crates exists in the current working directory.

Expected behavior

The popup window opens

Additional context/Screenshots

image
Occurs if there exists a directory called crates (common for workspaces) in the root

This is caused by the buffer name being set to cwd../crates and that is an existing directory

Possible solution

Neovim version

nvim --version
NVIM v0.9.0-dev-1023+g649742821                                                                                                                                                                                                                                 
Build type: RelWithDebInfo                                                                                                                                                                                                                                      
LuaJIT 2.1.0-beta3                                                                                                                                                                                                                                              
Compilation: /usr/bin/cc -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wno-unused-result -Wimplicit-fallthrough -Wvl
a -fno-common -fdiagnostics-color=always -fstack-protector-strong -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DMIN_LOG_LEVEL=3 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/tei/de
v/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/home/tei/dev/neovim/.deps/usr/include -I/home/tei/dev/neovim/.deps/usr/include -I/home/tei/dev/neovim/.deps/usr/include -I/home/tei/dev/neovim/.deps/usr/include -I/home/tei/dev/neovim/build/src/nvim/a
uto -I/home/tei/dev/neovim/build/include -I/home/tei/dev/neovim/build/cmake.config -I/home/tei/dev/neovim/src -I/home/tei/dev/neovim/.deps/usr/include -I/home/tei/dev/neovim/.deps/usr/include -I/home/tei/dev/neovim/.deps/usr/include                        
                                                                                                                                                                                                                                                                
   system vimrc file: "$VIM/sysinit.vim"                                                                                                                                                                                                                        
  fall-back for $VIM: "/usr/local/share/nvim"                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                
Run :checkhealth for more info                          

False positive on duplicate crate entry

Current behavior

Using the same dependency twice with different versions (and name) shows an error, but does compile.

Expected behavior

The dependency shouldn't be flagged if the name used is different.

Reproducing

# wayland-client here but should work with any dependency.

[dependencies.wayland-client-beta]
package = "wayland-client"
version = "0.30.0-beta.8"

[dependencies.wayland-client]
package = "wayland-client"
version = "0.29.4"

Neovim version

nvim --version
NVIM v0.7.2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=malloc -Wsuggest-attribute=cold -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/var/tmp/portage/app-editors/neovim-0.7.2/work/neovim-0.7.2_build/config -I/var/tmp/portage/app-editors/neovim-0.7.2/work/neovim-0.7.2/src -I/usr/include -I/var/tmp/portage/app-editors/neovim-0.7.2/work/neovim-0.7.2_build/src/nvim/auto -I/var/tmp/portage/app-editors/neovim-0.7.2/work/neovim-0.7.2_build/include
Compiled by portage@localhost

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "/etc/vim/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Breaking changes on main

This issue tracks the breaking changes on the main branch.

We follow the Conventional Commits specification, so breaking changes will always be marked with an !. If you use packer.nvim or lazy.nvim, they will be highlighted on update.

If you find breaking changes too disruptive to your workflow, the recommendation is to either follow the stable tag which should point to the most recent release, or even pin a release tag directly like v0.4.0.

Add video/gif showcasing plugin features

Add a short video or gif showcasing the features of this plugin

  • nvim-cmp completion
  • open the versions popup
    • select a version using smart insert
  • open the features popup
    • enable/disable features
    • disable default features

No version match with wildcard

Current behavior

When using only * in a crate version, a "No match" message appears, even though this is valid and cargo will accept it.
This does not happen if I use 0.* or any other string that doesn't just contain a wildcard.

Expected behavior

The "No match" message should not appear.

Additional context/Screenshots

Expected behavior:
image
Current behavior:
image

Neovim version

nvim --version
NVIM v0.7.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/nvim/parts/nvim/build/build/config -I/build/nvim/parts/nvim/build/src -I/build/nvim/parts/nvim/build/.deps/usr/include -I/usr/include -I/build/nvim/parts/nvim/build/build/src/nvim/auto -I/build/nvim/parts/nvim/build/build/include
Compiled by root@lcy02-amd64-012

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Error when using workspace crate with custom features

Current behavior

Getting Error fetching crate when using features with a workspace crate.

Expected behavior

No error.

Additional context/Screenshots

Minimal reproduction:

==> Cargo.toml <==
[workspace]
members = ["crate1", "crate2"]

[dependencies]
crate1 = { version="0.1", path = "crate1" }
crate2 = { version="0.1", path = "crate2" }

==> crate1 <==

==> crate1/Cargo.toml <==
[package]
name = "crate1"
version = "0.1.0"
edition = "2021"

[dependencies]

==> crate1/src <==

==> crate1/src/lib.rs <==
# crate1

==> crate2 <==

==> crate2/Cargo.toml <==
[package]
name = "crate2"
version = "0.1.0"
edition = "2021"

[dependencies]
crate1 = { workspace=true, features = [] }  # <===== `Error fetching crate`

==> crate2/src <==

==> crate2/src/lib.rs <==
# crate2

Neovim version

nvim --version
NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"

`health#report_start` deprecation warning

On nightly neovim, there is currently a deprecation warning for the following health related functions.

- *health#report_error* *vim.health.report_error()*	Use |vim.health.error()| instead.
- *health#report_info* *vim.health.report_info()*	Use |vim.health.info()| instead.
- *health#report_ok* *vim.health.report_ok()*		Use |vim.health.ok()| instead.
- *health#report_start* *vim.health.report_start()*	Use |vim.health.start()| instead.
- *health#report_warn* *vim.health.report_warn()*	Use |vim.health.warn()| instead.

They will be removed in Nvim version 0.11.

Not a huge deal but I thought I'd mentioned that this can be avoided by using the following in your health.lua (I guess .tl in this case).

local health = vim.health or require "health"
local health_start = health.start or health.report_start
local health_ok = health.ok or health.report_ok
local health_warn = health.warn or health.report_warn
local health_error = health.error or health.report_error

This will keep backwards compatibility with Nvim 0.9 while avoiding the deprecation warning & eventual deprecation.

Freezes neovim for several seconds

Description

Using this plugin with the leptos_icons causes neovim to hard lock for 5-10 seconds when opening the cargo.toml file. While it is locked it shows the loading status for leptos_icons.

leptos_icons has 23220 feature flags! Due to that, I would guess the problem is caused by something with how crates.nvim handles features.

Neovim version

NVIM v0.9.4 Build type: Release LuaJIT 2.1.1700008891

Operating system and version

EndeavorOS (arch based)

Expected behavior

Ideally it would not prevent doing other things while it loads. Should probably handle crates with lots of features faster or have some sort of cap before it bails gracefully. Alternatively an easy fix might be to provide a way for us to blacklist certain problematic crates from autoload.

Actual behavior

Locks up neovim for ~5-10 seconds

Minimal config

return require('packer').startup(function(use)
    use {
        "saecki/crates.nvim",
        requires = { "jose-elias-alvarez/null-ls.nvim" },
        config = function()
            require("crates").setup {
                src = {
                    cmp = {
                        enabled = true,
                    }
                },
                null_ls = {
                    enabled = true,
                    name = "crates.nvim",
                },
            }
            require("null-ls").setup {}
        end
    }
end)

Cargo.toml

[dependencies]
leptos_icons = { version = "0.1.0", features=["OcAlertFillSm"]}

Steps to reproduce

  1. use any nvim setup you have that has crates.nvim with autoload enabled
  2. cargo add leptos_icons
  3. nvim Cargo.toml
  4. Observe that you can't do anything for awhile as it is locked up.

autoupdate (throttle) exception.

Current behavior

This error seems to be triggered if one edits too quickly:

Error executing vim.schedule lua callback: .../.local/share/nvim/lazy/crates.nvim/lua/crates/async.lua:45: attempt to index upvalue 'timer' (a nil value)
stack traceback:
	.../.local/share/nvim/lazy/crates.nvim/lua/crates/async.lua:45: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>
"~/dev/home/zoned/exodus/Cargo.toml" 70L, 1323B

Expected behavior

No exception. :)

Possible solution

Since timer is defined outside both the function and the vim.schedule_wrap() callback:

local timer: vim.loop.Timer = nil

Neovim version

nvim --version
$ nvim --version
NVIM v0.10.0-dev-399+g7a8402ac3-Homebrew
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/HEAD-7a8402ac/share/nvim"

Run :checkhealth for more info

feature: show version from workspace `Cargo.toml`

In a Rust workspace, in subcrates you can do some-dep = { workspace = true } to pull dependencies from the shared Cargo.toml at the workspace root. Would it be possible to parse that and then lookup the version from the workspace?

Toml LSP completion takes precendence over crates

Current behavior

When getting completion for the version field, I am instead getting generic TOML LSP completion.

Expected behavior

crates.nvim takes precedence when in a Cargo.toml buffer.

Additional context/Screenshots

Using the taplo LSP for TOML.
Tested on both crates 0.3 and 0.4 recently.

Possible solution

Neovim version

nvim --version
output of nvim --version

0.9.2

Ignoring invalid config key 'src.cmp'

Description

Getting the message "Ignoring invalid config key 'src.cmp'" after fresh install, with default configs (copy-pasted), not modified.

Neovim version

NVIM v0.9.4

Operating system and version

macOS Ventura 13.5.1 (22G90)

Expected behavior

No response

Actual behavior

I get the message but still can call the functions to upgrade, open the features popup...

Minimal config

-- comment out, and add the things that are _necessary_ for reproducing the ISSUE
for name, url in pairs({
    crates = "/home/tobi/Projects/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

Steps to reproduce

  1. nvim --clean -u minimal.lua
  2. ...

Issue with latest Neovim nightly

I installed crates.nvim using Packer.
I tried both v1.0 and the latest master.
Nothing was happening when opened Cargo.toml and moved my cursor to one of the dependencies, and started editing the version.
So I tried :lua require('crates').show()

Got this error, it shows the same error twice in a row:

Error executing vim.schedule lua callback: .../pack/packer/start/crates.nvim/lua/crates/diagnostic.lua:150: attempt to index field 'text' (a nil value)
stack traceback:
        .../pack/packer/start/crates.nvim/lua/crates/diagnostic.lua:150: in function 'process_crate_versions'
        ...e/nvim/site/pack/packer/start/crates.nvim/lua/crates.lua:111: in function 'c'
        ...im/site/pack/packer/start/crates.nvim/lua/crates/api.lua:175: in function ''
        vim.lua: in function <vim.lua:0>
Press ENTER or type command to continue
Error executing vim.schedule lua callback: .../pack/packer/start/crates.nvim/lua/crates/diagnostic.lua:150: attempt to index field 'text' (a nil value)
stack traceback:
        .../pack/packer/start/crates.nvim/lua/crates/diagnostic.lua:150: in function 'process_crate_versions'
        ...e/nvim/site/pack/packer/start/crates.nvim/lua/crates.lua:111: in function 'c'
        ...im/site/pack/packer/start/crates.nvim/lua/crates/api.lua:175: in function ''
        vim.lua: in function <vim.lua:0>
Press ENTER or type command to continue

When I run it again, I get a slightly different error:

E5108: Error executing lua .../pack/packer/start/crates.nvim/lua/crates/diagnostic.lua:150: attempt to index field 'text' (a nil value)
stack traceback:
        .../pack/packer/start/crates.nvim/lua/crates/diagnostic.lua:150: in function 'process_crate_versions'
        ...e/nvim/site/pack/packer/start/crates.nvim/lua/crates.lua:144: in function 'update'
        ...e/nvim/site/pack/packer/start/crates.nvim/lua/crates.lua:195: in function 'show'
        [string ":lua"]:1: in main chunk
Press ENTER or type command to continue

Neovim version

nvim --version
NVIM v0.7.0-dev+778-g9dd855792
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-11 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az121-138

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info
:checkhealth
  2 crates: require("crates.health").check()
  3 ========================================================================
  4 ## Checking for required plugins
  5   - OK: plenary.nvim installed
  6
  7 ## Checking for external dependencies
  8   - OK: curl installed

Support for `package = "<package_name>"`

I am using the following syntax for declaring a dependency

<alternate_name> = { package = "<package_name>", version = "<package_version>" }

such as

sctk = { package = "smithay-client-toolkit", version = "0.15.3" }

This plugin is having a difficult time recognizing the format and gives the error "Error fetching crate". Can support for this format be added?

Way to ignore crates from certain git URL's or local

Current behavior

Currently if crates does not find a dependency from a private or public git url, it cannot find a version, and displays an error. This also happens for local dependencies

Expected behavior

ignore some crates

Additional context/Screenshots

Screenshot from 2022-09-14 14-28-18

Possible solution

allow users to ignore dependencies from certain git urls

Neovim version

nvim --version
NVIM v0.8.0-dev
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by nixbld

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/nix/store/q9qclq0i7iiymrdyyp0lkwcycnsq081l-neovim-unwrapped-master/share/nvim
"

Run :checkhealth for more info

No command is working

It shows me the version of the crates beside, but when I try to run some commands when I stay on the same line with crate name - it doesn't do anything at all. For example I try to call lua require('crates').open_crates_io() on any crate and it doesn't work. The only command which works - lua require('crates').show_versions_popup()

Add support for rust-script's in source file dependencies

Hello. I recently found out about https://rust-script.org/, which sounds like a great substitution for shell/python scripts that I have a ton of. I made my first Rust script a few days ago and it is awesome. The problem is that rust-analyzer only works with cargo projects and doesn't help when a single-file project is opened. But another issue is that to make the script "portable" you have to include dependencies in the Rust file:

image

And I was wondering if it will be possible to make this plugin work with this embedded version of Cargo.toml's dependencies. I have to modify dependencies in the Cargo.toml first and then copy/sync them with the rust-script's place for those dependencies. If this plugin can work right in the Rust file, then I would only have to open a single file, which makes the workflow much simpler and quicker. (Though for rust-analyzer to work, I would still have to modify Cargo.toml...oh well...)

`nvim-cmp` completions for crates don't show up

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 my nvim-cmp:

cmp.setup {
  -- other settings omitted for brevity
  sources = cmp.config.sources({
    { name = 'nvim_lsp' },
    { name = 'luasnip' },
    { name = 'crates' },
  }),
}

Verified for crates.nvim versions 0.3, 0.4

Possible solution

Neovim version

nvim --version
output of nvim --version

0.9.2

Error on `package.path` shorthand

Current behavior

If I write package = { path = "../package" }, everything works just fine. But if I instead write package.path = "../package", it gives an error Error fetching crate. I think those two are supposed to be equivalent in TOML โ€” cargo accepts it without complaining, at least.

Does the same if I write for example extend.version = "1.1.0", though that's less important since there's already a convenient shorthand for that.

Expected behavior

Treat the above two snippets as equivalent and don't error.

Neovim version

nvim --version
NVIM v0.8.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

nvim-cmp trigger needs some improvement

Current behavior

This is an awesome plugin, but the nvim-cmp trigger could be improved. For me it doesn't trigger on the first ", but I have to type another ", and then press backspace in order to get the completion list to pop up.

Also, with autopair plugins like ultimate-autopair.nvim which adds a second " right after my cursor when I type a first ", I can't get the menu to pop up when typing.

Expected behavior

The nvim-cmp completion menu shows up immediately when I type ", even with an autopair plugin.

Additional context/Screenshots

Here's a minimal config to reproduce the issue:

Click to expand
local root = vim.fn.fnamemodify(vim.fn.expand('$HOME') .. '/nvim-test-config', ':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)

local plugins = {
  {
    'altermo/ultimate-autopair.nvim',
    branch = 'v0.6',
    config = function()
      require('ultimate-autopair').setup({})
    end
  },
  {
    'saecki/crates.nvim',
    tag = 'v0.3.0',
    dependencies = 'nvim-lua/plenary.nvim',
    event = { "BufRead Cargo.toml" },
    config = function()
      require('crates').setup({})
    end
  },
  {
    'hrsh7th/nvim-cmp',
    config = function()
      local nvim_cmp = require('cmp')

      nvim_cmp.setup({
        sources = nvim_cmp.config.sources({ { name = "crates" } }),
        completion = {
          completeopt = 'menu,menuone,noinsert',
        }
      })
    end
  }
}

vim.keymap.set('n', '<c-q>', '<cmd>:qa!<cr>')

require('lazy').setup(plugins, {
  root = root .. '/plugins',
})

Neovim version

nvim --version
NVIM v0.10.0-dev-dfa8b58
Build type: RelWithDebInfo
LuaJIT 2.1.1695653777
Run "nvim -V1 -v" for more info

Crate versions are lexicographically sorted in completion

Current behavior

The crates versions supplied to the completion are sorted lexicographically, which causes 0.1.9 to be given higher priority over 0.1.11 which is buries underneath the 0.1.1 version.

Expected behavior

The crates versions are returned in semantic version order, as the user most likely want't the most recent version when adding a crate.

E.g; 0.1.11, 0.1.10, 0.1.9 etc

Additional context/Screenshots

Screenshot 2023-05-30 at 11 43 35

Neovim version

nvim --version
NVIM v0.10.0-dev-1769+g9dd48f783-Homebrew
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/HEAD-9dd48f7/share/nvim"

Run :checkhealth for more info

feature: support private registries

Hello, I use a private registry for some crates at work, unfortunately this plugin is not able to fetch the crate versions from there.

Are there plans to support private registries?

Screen Shot 2023-02-03 at 15 05 44

False positive `Incorrect crate name casing` diagnostic

In some cases we got false positive diagnostic about crate name casing.

Here is a bash script to build a workspace which will reproduce the bug:

#!/bin/bash

cargo init demo
cargo init --lib demo/web-server
cargo init --lib demo/webserver
cargo init --lib demo/eb-server

echo 'web-server = { path = "web-server" }' >> demo/Cargo.toml
echo 'webserver = { path = "webserver" }' >> demo/Cargo.toml
echo 'eb-server = { path = "eb-server" }' >> demo/Cargo.toml

Then if you open demo/Cargo.toml in the editor, you'll see, that dependencies web-server and webserver are reported as crates with invalid name casing, but eb-server is not.

EMFILE: too many open files

Current behavior

EMFILE: too many open files error on opening a Cargo.toml with a large number of dependencies (110 normal deps & 50 workspace deps for me)

Expected behavior

No error

Additional context/Screenshots

Related: #43

Cargo.toml

I've removed the workspace deps because I can't share them, but here is what all of them look like:

name1 = { version = "0.1", path = "lib/some/name" }
# or
name2 = { version = "0.1", path = "lib/other/name" }
# or
name3 = { version = "0.1", path = "tools/name" }

I've 50 of them.

[workspace]
members = ["lib/*", "tools/*"]
exclude = ["snippets", "tmp"]

[profile.release]
opt-level = 3
debug = true
lto = "thin"
codegen-units = 1

[profile.dev]
opt-level = 1 # this speeds up the test suite runtime by about 10x

[workspace.package]
edition = "2021"

[workspace.dependencies]
# external
ahash = "0.8"
arrayvec = { version = "0.7", features = ["serde"] }
arrow2 = { version = "0.17", features = ["io_ipc", "io_ipc_compression"] }
async-compression = { version = "0.3", features = ["tokio", "zstd"] }
async-trait = "0.1"
atoi = "2.0"
aws-config = { version = "0.55", default-features = false, features = ["rustls"] }
aws-sdk-apigateway = { version = "0.27", default-features = false, features = ["rustls"] }
aws-sdk-s3 = { version = "0.27", default-features = false, features = ["rustls", "rt-tokio"] }
aws-sdk-secretsmanager = { version = "0.27", default-features = false, features = ["rustls"] }
aws-smithy-types = "0.55"
aws-smithy-types-convert = { version = "0.55", features = ["convert-time"] }
base64 = "0.21"
base64-simd = "0.8.0"
bitvec = "1.0"
bstr = "1.4"
bus = "2.4"
byteorder = "1.4"
bytes = "1.4"
clap = { version = "4.2", features = ["derive", "string"] }
const_format = "0.2"
core_affinity = "0.8"
crossbeam-channel = "0.5"
csv = "1.2"
derive_more = "0.99"
dotenvy = "0.15"
dyn-clone = "1.0"
enumflags2 = { version = "0.7", features = ["serde"] }
errgo = "0.1"
eyre = "0.6"
fastrand = "1.9"
flate2 = { version = "1.0", features = ["zlib-ng"], default-features = false }
flume = "0.10"
futures = { version = "0.3", default-features = false }
generic-array = "0.14"
gethostname = "0.4"
glob = "0.3"
hex-simd = "0.8"
hmac = { version = "0.12", features = ["reset"] }
http = "0.2"
httparse = "1.8"
httpmock = "0.6"
indicatif = { version = "0.17", features = ["improved_unicode"] }
itertools = "0.10"
itoap = "1.0"
lambda_runtime = "0.8"
libc = "0.2"
likely_stable = "0.1"
minstant = "0.1"
network-interface = "1.0"
num-derive = { version = "0.3" }
num-integer = { version = "0.1", features = ["i128"] }
num-traits = { version = "0.2", features = ["i128"] }
once_cell = "1.17"
paste = "1.0"
proc-macro-error = "1.0"
proc-macro2 = "1.0"
quote = "1.0"
rand = { version = "0.8", features = ["small_rng"] }
regex = "1.7"
reqwest = { version = "0.11", features = ["rustls-tls-webpki-roots", "gzip", "json", "stream", "trust-dns"], default-features = false }
rtrb = "0.2"
rust_decimal = { version = "1.29", features = ["serde"] }
rustc-hash = "1.1"
rustls = "0.21"
rustls-native-certs = "0.6"
secrecy = { version = "0.8", features = ["serde"] }
seq-macro = "0.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_test = "1.0"
serde_urlencoded = "0.7"
serde_with = "3.0"
serde_yaml = "0.9"
sha1 = "0.10"
sha2 = "0.10"
simd-json = { version = "0.9", features = ["allow-non-simd", "approx-number-parsing", "known-key"] }
smallvec = { version = "1.10", features = ["const_generics", "const_new", "union"] }
socket2 = { version = "0.5", features = ["all"] }
static_assertions = "1.1"
strum = { version = "0.24", features = ["derive"] }
syn = { version = "2.0", features = ["parsing", "proc-macro"], default-features = false }
tabled = { version = "0.10", features = ["derive"] }
tabwriter = "1.2"
thingbuf = { version = "0.1" }
thiserror = "1.0"
time = { version = "0.3", features = ["serde", "parsing", "formatting", "serde-well-known", "macros"] }
tokio = { version = "1.27", features = ["rt-multi-thread", "time", "macros"] }
tokio-util = { version = "0.7", features = ["io", "io-util"] }
tracing = { version = "0.1", features = ["log"] }
tracing-core = { version = "0.1" }
tracing-log = { version = "0.1" }
tracing-subscriber = { version = "0.3", features = ["env-filter", "registry"] }
tungstenite = { version = "0.19", features = ["rustls-tls-native-roots"] }
ureq = { version = "2.6", features = ["json", "tls", "native-certs"] }
url = { version = "2.3", features = ["serde"] }
urlencoding = "2.1"
vec1 = { version = "1.10", features = ["serde"] }
webpki = "0.22"
zstd = { version = "0.12", features = ["zstdmt"] }
zstd-safe = { version = "6.0", features = ["zstdmt"] }

# dev-dependencies
assert_matches = "1.5"
criterion = "0.4"
proptest = "1.1"
ring = "0.16"
rstest = "0.17"
serial_test = "2.0"
tempfile = "3.5"
Error
[Neo-tree ERROR] Error opening file: vim/_editor.lua:0: nvim_exec2()..BufReadPost Autocommands for "Cargo.toml": Vim(append):Error executing lua callback: .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:405: Failed to spawn process: {
  _additional_on_exit_callbacks = {},
  _shutdown_check = <userdata 1>,
  _stderr_results = {},
  _stdout_results = {},
  _user_on_exit = <function 1>,
  args = { "-sL", "-A", "'crates.nvim (https://github.com/saecki/crates.nvim)'", "https://crates.io/api/v1/crates/regex" },
  command = "curl",
  enable_handlers = true,
  enable_recording = true,
  interactive = true,
  pid = "EMFILE: too many open files",
  stderr = <userdata 2>,
  stdin = <userdata 3>,
  stdout = <userdata 4>,
  user_data = {},
  <metatable> = <1>{
    __index = <table 1>,
    _create_uv_options = <function 2>,
    _execute = <function 3>,
    _pipes_are_closed = <function 4>,
    _prepare_pipes = <function 5>,
    _reset = <function 6>,
    _shutdown = <function 7>,
    _stop = <function 8>,
    add_on_exit_callback = <function 9>,
    after = <function 10>,
    after_failure = <function 11>,
    after_success = <function 12>,
    and_then = <function 13>,
    and_then_on_failure = <function 14>,
    and_then_on_failure_wrap = <function 15>,
    and_then_on_success = <function 16>,
    and_then_on_success_wrap = <function 17>,
    and_then_wrap = <function 18>,
    chain = <function 19>,
    chain_status = <function 20>,
    co_wait = <function 21>,
    is_job = <function 22>,
    join = <function 23>,
    new = <function 24>,
    pid = <function 25>,
    result = <function 26>,
    send = <function 27>,
    shutdown = <function 28>,
    start = <function 29>,
    stderr_result = <function 30>,
    sync = <function 31>,
    wait = <function 32>
  }
}
stack traceback:
	.../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:405: in function '_execute'
	.../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:448: in function 'start'
	...sh/.local/share/nvim/lazy/crates.nvim/lua/crates/api.lua:186: in function 'fetch_crate'
	...sh/.local/share/nvim/lazy/crates.nvim/lua/crates/api.lua:191: in function 'data'
	.../.local/share/nvim/lazy/crates.nvim/lua/crates/async.lua:11: in function 'exec'
	.../.local/share/nvim/lazy/crates.nvim/lua/crates/async.lua:14: in function 'launch'
	.../.local/share/nvim/lazy/crates.nvim/lua/crates/async.lua:19: in function 'reload_crate'
	...h/.local/share/nvim/lazy/crates.nvim/lua/crates/core.lua:125: in function 'update'
	...h/.local/share/nvim/lazy/crates.nvim/lua/crates/init.lua:149: in function 'update'
	...h/.local/share/nvim/lazy/crates.nvim/lua/crates/init.lua:87: in function <...h/.local/share/nvim/lazy/crates.nvim/lua/crates/init.lua:86>
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function <vim/_editor.lua:0>
	[C]: in function 'pcall'
	...cal/share/nvim/lazy/neo-tree.nvim/lua/neo-tree/utils.lua:609: in function 'open_file'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:568: in function 'open'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:599: in function 'open_with_cmd'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:608: in function 'open'
	...o-tree.nvim/lua/neo-tree/sources/filesystem/commands.lua:184: in function 'func'
	...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:787: in function <...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:785>
stack traceback:
	[C]: in function 'error'
	.../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:405: in function '_execute'
	.../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:448: in function 'start'
	...sh/.local/share/nvim/lazy/crates.nvim/lua/crates/api.lua:186: in function 'fetch_crate'
	...sh/.local/share/nvim/lazy/crates.nvim/lua/crates/api.lua:191: in function 'data'
	.../.local/share/nvim/lazy/crates.nvim/lua/crates/async.lua:11: in function 'exec'
	.../.local/share/nvim/lazy/crates.nvim/lua/crates/async.lua:14: in function 'launch'
	.../.local/share/nvim/lazy/crates.nvim/lua/crates/async.lua:19: in function 'reload_crate'
	...h/.local/share/nvim/lazy/crates.nvim/lua/crates/core.lua:125: in function 'update'
	...h/.local/share/nvim/lazy/crates.nvim/lua/crates/init.lua:149: in function 'update'
	...h/.local/share/nvim/lazy/crates.nvim/lua/crates/init.lua:87: in function <...h/.local/share/nvim/lazy/crates.nvim/lua/crates/init.lua:86>
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function <vim/_editor.lua:0>
	[C]: in function 'pcall'
	...cal/share/nvim/lazy/neo-tree.nvim/lua/neo-tree/utils.lua:609: in function 'open_file'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:568: in function 'open'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:599: in function 'open_with_cmd'
	...y/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:608: in function 'open'
	...o-tree.nvim/lua/neo-tree/sources/filesystem/commands.lua:184: in function 'func'
	...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:787: in function <...are/nvim/lazy/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:785>

Possible solution

After a certain number of dependencies, say 50, batching should be used to fetch whatever information is required (I've not looked into the internals)
Also, ideally, dependencies with path or git + branch or git + rev should be skipped?

Neovim version

I am on macOS 13.3 if that helps.

nvim --version
NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3

same dependency in build-dependencies and others are counted as duplicate

Current behavior

A build-dependency is showing an duplicate-entry error even though these are separate.

Expected behavior

no error, since build-dependencies and the others are separate

Additional context/Screenshots

grafik

Possible solution

Neovim version

nvim --version
NVIM v0.6.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@BigSur

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.6.0/share/nvim"

Run :checkhealth for more info

Question: Are both cmp and null-ls integration necessary?

Hi! I'm considering installing your plugin, and I'm currently using nvim-cmp, but this is the first time I've heard about null-ls.

I'm not quite sure about how to integrate these three plugins (this one, null-ls, nvim-cmp): If I configure null-ls integration for this plugin, and configure null-ls as a completion source in nvim-cmp, do I still need to enable this plugin's nvim-cmp completion source as well, or is that already handled via null-ls?

Some feature wrongly considered invalid

Hello,

Current behavior

Some features are considered invalid, but are in fact valid, and documented on the crate's doc.rs page.
For example :

  • the "uuidv07" of crate diesel v1.4.8
  • the "serde" feature of create uuid v0.8.2

Expected behavior

Features that are listed in docs.rs don't trigger an "Invalid feature" diagnostic

Additional context/Screenshots

image

Neovim version

nvim --version
NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Thanks for the great plugin.
Cheers.

`show_features_popup()` not works some crate

I'm not good at English, sorry.

I ran :lua require'crates'.show_features_popup() on start of line 12.
Popup didn't appear and error executed.

image

If features array is empty array, popup appears.
Also I was able to toggle features but error excuted every toggle and popup didn't seem to update.

image

But works with serde and rand crate. Popup appeared and I was able to toggle features without error.

image

show_popup() on features is equivalent to show_features_popup().

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.