-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add an option to limit BlockEnd hints to tall blocks #1807
Comments
I believe we had one in the original patch, but it was removed as requested in the code review. We decided to try to configure a good default in clangd. @sam-mccall for comment. |
I'm seeing the hints even after blocks with a 1-line body. |
It looks like the limit currently in the code is 2, and the block height is considered to include the lines with the braces, so the only blocks that are excluded are the ones where the braces are on the same line. I think I'd want to set the minimum to something in the 6-10 line range. I suppose I'd be fine with a hard-coded limit in that range, but I also feel like this is an area where different developers may have different preferences. |
Yeah, this depends on the font size and how tall people's screen gets. Though I think the number should be large enough so it's not getting too dense in noise yet not too large so the threshold exceeds the number of lines the screen could display. In this case, 6-10 sounds good to me. |
@HighCommander4 Do you want to me handle this issue? We have to determine either we want to add a config or update the minimum line requirement. I started using clangd17 lately and noticed the verboseness is amplified by new hints added at end of statement blocks. |
Sure, please go ahead. I think just changing the hard-coded limit for now should be fine. If we get users asking for the hints on shorter blocks, we can consider a config option at that time. |
I've been using clangd 17 with the new
BlockEnd
inlay hints added in #1634, and I'm finding that the hints are quite useful for tall blocks (say, more than 10 lines) where the beginning of the block is more likely to be offscreen, but just add visual noise for shorter blocks where the beginning of the block is more likely to be on-screen.It might be nice to add a config option to set the minimum number of lines a block should be to get the hint.
@daiyousei-qz what do you think?
The text was updated successfully, but these errors were encountered: