feat(cmp): disable item.menu for Rust filetypes (#3858)

## What is this PR for?
Tries to improve aesthetics for `nvim-cmp` in Rust by disabling
`item.menu` since it contains the `return` types that take up too much
space.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Does this PR fix an existing issue?
Fixes #3855
<!--
  If this PR fixes any issues, please link to the issue here.
  Fixes #<issue_number>
-->

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
This commit is contained in:
Iordanis Petkakis
2024-06-29 22:04:40 +03:00
committed by GitHub
parent 8c900f92e7
commit ee44b21898

View File

@ -49,11 +49,14 @@ return {
{ name = "buffer" },
}),
formatting = {
format = function(_, item)
format = function(entry, item)
local icons = LazyVim.config.icons.kinds
if icons[item.kind] then
item.kind = icons[item.kind] .. item.kind
end
if entry.context.filetype == "rust" then
item.menu = nil
end
return item
end,
},