Sublime Forum

How to change icon for Kind info

#1

When writing code with LSP, if an auto complete suggestion is a function, it’s a red function symbol. Neat. If it’s a field however, it’s a blue function symbol. Not so neat. In fact, that’s very confusing and messes with me. Is there any way to change this “Kind” info icon for a certain type? A field is in fact not a function, so it would be greatly appreciated if someone were to let me know how.

0 Likes

#2

Kind Info is defined in *.sublime-completions or by the plugin providing completions.

The kind icon can be an unicode character. Most plugins however go with ascii chars as some unicode letters look bad when rendered italic or may be missing from some commonly used fonts.

LSP hard-codes kind info in source code. So there’s no recommended (and safe) way to change the icon.

0 Likes

#3

When you say “LSP hard-codes kind info in source code” What do you mean by this? Do you mean kind info is sent as a utf-8 character? How is this information sent. The info I see is “field,” which is correct, but the LSP isn’t sending the actual information to use that function image, is it?

0 Likes

#4

LSP package maps LSP CompletionItemKind to Sublime kind info at https://github.com/sublimelsp/LSP/blob/33c6497aae4ad5a952196d652f2f3557d6618fbc/plugin/core/views.py#L72-L142.

It uses the first letter of the kind name as the icon.

0 Likes