mrcjkb / rustaceanvim

Supercharge your Rust experience in Neovim! A heavily modified fork of rust-tools.nvim
GNU General Public License v2.0
1.3k stars 47 forks source link

autocomplete always adds $0 at the end #393

Closed alekspickle closed 2 months ago

alekspickle commented 2 months ago

Have you read the docs and searched existing issues?

Neovim version (nvim -v)

v0.9.1

Operating system/version

Ubuntu 23.10

Output of :checkhealth rustaceanvim

rustaceanvim: require("rustaceanvim.health").check()

Checking for Lua dependencies ~
- OK [mfussenegger/nvim-dap](https://github.com/mfussenegger/nvim-dap) installed.

Checking external dependencies ~
- OK rust-analyzer: found rust-analyzer 1.78.0 (9b00956 2024-04-29)
- OK Cargo: found cargo 1.78.0 (54d8815d0 2024-03-26)
- OK rustc: found rustc 1.78.0 (9b00956e5 2024-04-29)

Checking config ~
- OK No errors found in config.

Checking for conflicting plugins ~
- OK No conflicting plugins detected.

Checking for tree-sitter parser ~
- OK tree-sitter parser for Rust detected.

How to reproduce the issue

require("mini.completion").setup{}

# and then just try any function with completion

fn main() {
 let var = std::env::*Tab*
}

Expected behaviour

fn main() { let var = std::env::var() }

Actual behaviour

fn main() { let var = std::env::var(${1:key})$0 }

The minimal config used to reproduce this issue.

-- [[ lazy.lua ]]
return require('lazy').setup({
    {
        -- Awesome lightweight overall life improvement collection of plugins
        { 'echasnovski/mini.nvim', version = false },
        -- Rust support
        { 'mrcjkb/rustaceanvim', version = '^4',
            lazy = false, -- This plugin is already lazy
        }
})

require("mini.completion").setup{}
-- and minimal rustacean config
alekspickle commented 2 months ago

I did create an issue with mini.completion first, but they said it is lsp fault, and I experience this only with rust LSP

I'm not even sure it's even a bug or am I just stoopid and don't know how LSPs work in general, but any help would be appreciated.