saecki/crates.nvim

Toml LSP completion takes precendence over crates

Closed this issue · 7 comments

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

saecki commented

First of all, what completion engine are you using? If it's nvim-cmp that's up to you to configure.

nvim-cmp, with crates as one of the sources below nvim_lsp

Not sure what you mean, if it's that crates should be higher on the sources list, I tried that without anything changing.

EDIT: also, this issue seems to have appeared out of the blue for me, as even with crates below nvim_lsp, I used to get crates completions until recently.

saecki commented

I can't find any way to set the priority on the source side, maybe you can look into this:

https://github.com/hrsh7th/nvim-cmp/blob/5dce1b778b85c717f6614e3f4da45e9f19f54435/doc/cmp.txt#L620C46-L620C46

I'm starting to suspect it's not a precedence issue, but that crates completion source has stopped working for me altogether. If it helps I could reword this issue.

saecki commented

Yeah, either that or open a new one.