-
-
Notifications
You must be signed in to change notification settings - Fork 258
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
feat: add background highlight to LSP signature help #771
feat: add background highlight to LSP signature help #771
Conversation
Hello! I was thinking about making a similar change for this group myself. I do agree that a background color would be nice, but I also think that by having a different background color, there's no need to set a foreground color at all. By not setting a foreground color, we can have a better context for the parameter using treesitter (that's specially nice when it comes to complex parameters). Another reason to not set a foreground at all is that there will always be some overlap between the foreground color and another highlight group for a given language (for instance, using the default Currently, I'm using LspSignatureActiveParameter = {
fg = mocha.none,
bg = mocha.surface2,
style = { "bold" },
}, Which shows up as What do you think? |
Your change looks great, @igorlfs. Your version makes it even more apparent which parameter is active. A couple of questions came to mind:
|
Thanks!
I don't think that's needed. I assumed it was necessary since I was overriding the default one, but that doesn't seem to be the case
Either one is fine IMO
Using the same example I gave, but defining a foreground color: To me, it looks way messier. Since the color falls back to treesitter, I find it more appealing / clearer what type is expected for the parameter. |
01420be
to
8f99df4
Compare
Thanks for the answers! I updated the PR accordingly. I kept the background as |
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.
This is pretty embarassing but I reviewed the wrong repository, will look at this PR later!
8f99df4
to
04b3589
Compare
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.
LGTM!
Two checks are failing, but the same errors happen on the main branch. |
@AndreasNasman Don't worry about the failing checks, we'll fix them separately. Before merging this PR, another change is requested in order to follow the style doc: bg Sorry for the long delay, I'm always offline at weekdays. |
Sorry it's taken me a while to come back to this. The only reason why I wouldn't want to use Are you okay with changing it to |
I used surface1 as the color, the same as those used by LspReferenceText, LspReferenceRead, and LspReferenceWrite.
04b3589
to
d21bf75
Compare
Thanks for the feedback 👍 I rebased on main and changed surface1 to surface0. |
I used surface1 as the color, the same as those used by LspReferenceText, LspReferenceRead, and LspReferenceWrite.
This change helps to highlight the current parameter under the cursor when invoking
vim.lsp.buf.signature_help
.Before the change
name: string
has a peach foreground but the same background as the other parameters, making it hard to distinguish.After the change
name: string
has a peach foreground and a surface1 background, making distinguishing from the other parameters easier.