-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Completion item kinds customization support V2 #12151
base: master
Are you sure you want to change the base?
Conversation
In order to avoid useless wrappers and useless allocations, add Hash support to `helix_lsp_types::completion::CompletionItemKind`.
Brilliant! Could you add a preset in the documentation to use Nerd Fonts, like the information you shared in the last PR? |
this screams "icons api" |
With such an API we could maybe complement the path completion too? Would be pretty cool! |
I meant just add the equivalent of the following from the last PR into the documentation so people can copy and paste it, changed to work with this PR. I don't see any documentation in this PR yet.
An "icons API" would be cool, but probably in another PR, this one is so nice and simple I hope it can be merged asap! |
5534dff
to
0548d8f
Compare
0548d8f
to
75d0989
Compare
Sure, where should this kind of recipe/example should go inside the docs? |
In the editor config I think, there are lots of example configs already: https://docs.helix-editor.com/editor.html |
editor.completion-item-kinds section and theming information
Documentation finished! @David-Else ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed the wording to hopefully make it clearer, please let me know if I have understood your original meaning correctly. You might want to mention the fact they can be styled and link to the theming documentation?
Co-authored-by: David Else <[email protected]>
ee1da05
to
f3093a0
Compare
…eat/completion-item-kinds
Yeah, this is not optimal at all.
Hey! Review and merging would be appreciated! I would also like to know if #12299 merged with this still works properly! |
Wouldn't it make more sense to put the config under lsp? This way there could be one place to source icons from. For example, a breadcrumb feature could access the same symbol information and get the icons from the config. I bring this up because this something i've missed and have been thinking about implementing. If you have configs here for the just for completion icons, then that feature would need to have its own separate icon list, or just spaghetti-code off of the completion icons. Something like: [editor.lsp.symbol-icons] |
I don't think so, since these icons are not exclusive to LSP and could apply to any source that gets implemented in helix (for now we only have the LSP and path ones) Though I still think a better name for the icon would be pretty nice. |
+ there are several other PRs whose sole purpose is to display (nerdfonts) icons in various places. helix has done many things significantly better than other editors, #2869 might be another one. |
The better thing would be to have this integrated with this kind of icon API PR, but such had become stale and outdated regarding the code base. I just implemented this the simplest way possible, though a larger-scale icon integration with the editor is the better way to go |
The issue with the old icons PR is that it had a problem of scale in the toml. At first it was a separate file from the config, and then just merged into the config file, which the maintainers didn't like (Let alone the config will switch to some scheme config in the future), it was still too many options. But with this, its sort of a smaller portion of the same issue. If one person adds icon support for the version control on the status bar, and you add icons for the completion menu, and I add icons for a breadcrumb, and someone else add icons for the file explorer, and someone else adds for the file type on the status bar, you end up with overlap of having to fill out the toml with the same thing. I think the maintainers might have issue with the same mountain that the icons api PR was even in pebble form, as that would be the trend that all these PRs lead to. Having to put the same icon in 3 different spots on the toml is not something I also want to do either. If the icons here are only for lsp things, then the thought is to put them in the lsp part, as other things that can use them can, and it will all cascade. Scaling this way would merge path and the file icons as they would use the same set, representing directories and filetypes. Diagnostics would have their own, as another open PR is trying to get merged. I think this covers like 99% of things id ever want icons for, and its just four domains (Though the GITY/VCS is really just one thing): LSP icons, Diagnostic Icons, and Path/File icons. This scales much better in toml and any new implimentation can piggyback already existing configs. I only bring this up now because I can see this potentially becoming a reason why the maintainers dont merge these things using the same reason as they didnt merge the icons pr, which I dont want. |
This is where I would love to see a maintainer help coordinate some efforts to make an acceptable "api" for these things. Or merge multiple prs into one with the config implimentation that best works. I think even something like this could work, and then just a matter of propagating where needed, and it keeps the scope well defined: [icons.lsp]
[icons.path]
[icons.diagnostic] |
the great thing about icons PR is that it includes defaults, so there is no need to share them in documentation/copy-paste from comments and keep them up to date + it's easy to turn them on/off. icons are similar to themes - most people don't have the artistic ambition to set hundreds of values in a configuration file. |
Except themes are just colors. Icons more often than not require patched fonts. If I recall correctly it was also an issue of how to handle not everyone having them. Having done a lot of Having defaults that everyone should be able to display, like what the diagnostic PR is doing iirc, and then offering the potential to override, is something that this project as a whole has been geared towards. Also something |
that's exactly what's great about icons PR - it treats icons as first-class citizens (not just as a byproduct of being able to manually override a few values) so they can have their own (nerdfonts) defaults too. |
@RoloEdits Agree on the sentiment that this is something maintainers help would befit. also your earlier suggestion regarding
Anyway, the latter approach seems more contained and portable.
And pretty solid and extensible too |
Nah you didn't hijack my PR, I'm cool with that Interesting proof of concept though, hope you can take it further! |
Basically a better version of #9996, avoiding useless allocations and hacky code (hopefully) in order to achieve this feature
This PR allows the user to customize the kind text shown inside the completion menu, allowing the end user to do the following:
kebab-case
, the user can override with for example:editor.completion-item-kinds.type-parameter = "..."