fannheyward / coc-rust-analyzer

rust-analyzer extension for coc.nvim
MIT License
1.13k stars 40 forks source link

rust-analyzer.completion.snippets.custom was not covered as expected, but was added instead #1222

Closed A4-Tacks closed 10 months ago

A4-Tacks commented 10 months ago

What's the output of :CocInfo

## versions

vim version: VIM - Vi IMproved 9.1 9010000
node version: v21.2.0
coc.nvim version: 0.0.82-e108777 2023-11-27 04:48:08 +0100
coc.nvim directory: /home/lrne/.vim/plugged/coc.nvim
term: dumb
platform: linux

## Log of coc.nvim

2024-01-30T12:44:46.710 INFO (pid:19049) [plugin] - coc.nvim initialized with node: v21.2.0 after 365
2024-01-30T12:44:49.110 INFO (pid:19049) [attach] - receive notification: showInfo []

What's the output of :CocCommand rust-analyzer.serverVersion

rust-analyzer 1.77.0-nightly (bf8716f1 2023-12-24)

What's your coc-rust-analyzer version? You can get it from :CocList extensions

* coc-rust-analyzer 0.75.1

coc-settings.json

"rust-analyzer.completion.snippets.custom": {
    "Abc::new": {
        "postfix": "abc",
        "body": "Abc::new(${receiver})",
        "scope": "expr"
    }
}
X.a
           arc~ (use std::sync::Arc) Put the expression into an `Arc`              S [LS]
           abc~ Abc::new                                                           S [LS]

expected

Old snippets should be overwritten and cleared instead of adding new ones to the old ones. like let letm .let .rc

fannheyward commented 10 months ago

The two snippets are provided by rust-analyzer language server, needs rust-analyzer support this.