nvim-cmp-lsp-rs
nvim-cmp-lsp-rs copied to clipboard
Refine nvim-cmp completion behavior by applying useful filtering and sorting for candidates from Rust Analyzer. (Won't cause side effects on other cmp sources)
## current Since the suggestion from https://github.com/zjp-CN/nvim-cmp-lsp-rs/issues/4#issuecomment-2041308464 ```lua local compare = require("cmp").config.compare opts.sorting.comparators = { compare.exact, compare.score, comparators.inscope_inherent_import, comparators.sort_by_label_but_underscore_last, } ```  when press `.` without any extra char, `compare.score`...
Currently, `sort_by_kind` is sorting from a fixed list. Given the default kind ordering in this plugin, Method is always prior to Function, then it works fine after typing `.`, but...
```toml [package] name = "xxx" version = "0.1.0" edition = "2021" [dependencies] color-eyre = "0.6.3" ratatui = "0.26" ``` ```rust #![allow(unused)] use ratatui::prelude::*; fn main() { let s = S...