Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: support labeldetail field #1873

Closed
xzbdmw opened this issue Apr 7, 2024 · 2 comments
Closed

feature request: support labeldetail field #1873

xzbdmw opened this issue Apr 7, 2024 · 2 comments

Comments

@xzbdmw
Copy link

xzbdmw commented Apr 7, 2024

Currently custom_view support three fields, kind, abbr and menu, and menu field is left-align, which is a bit awkward because if I set capabilities.textdocument.completion.labelDetailsSupport=true, some lsp(rust-analyzer for example) sends back something like:

    --  detail: {
    --   description = "pub fn shl(self, rhs: Rhs) -> Self::Output",
    --   detail = " (use std::ops::Shl)"
    -- }

and cmp simply concat these strings in menu field, something looks like:
截屏2024-04-08 02 37 33
and if I cut off menu field it looks like:
截屏2024-04-08 02 39 01
The disadvantage of this approach is that the starting position on the leftmost side of all menus must be greater than the longest string in abbr, leaving many remaining useless spaces in between, I would like add a new field called detail to stay closely behind abbr, and leave menu field right unchanged(left algin)

note: vscode indeed have a detail field in completion items, for detail, it follows abbr and for description, it sitck to right side.
截屏2024-04-08 02 47 40

@xzbdmw xzbdmw closed this as completed Apr 7, 2024
@bew
Copy link
Contributor

bew commented Apr 7, 2024

Why did you you close? @xzbdmw

@xzbdmw
Copy link
Author

xzbdmw commented Apr 7, 2024

Hmm, I just found left-align is more tidy for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants