Skip to content

Conversation

@daiyousei-qz
Copy link
Contributor

@daiyousei-qz daiyousei-qz commented Nov 15, 2023

Including:

  1. Explicitly state a function call. "// if foo" -> "// if foo()" or "// if foo(...)"
  2. Print literal nullptr
  3. Escape for abbreviated string
  4. Adjust min line limit to 10

Fixes issue clangd/clangd#1807

1. Explicitly state a function call
2. Print literal nullptr
3. Escape for abbreviated string
4. Adjust min line limit to 10
@daiyousei-qz
Copy link
Contributor Author

@HighCommander4 @sam-mccall for opinions.

I haven't update the test because the hard-coded limit 10 makes it hard to write the tests. Any opinion of how to structure this?

@HighCommander4
Copy link
Collaborator

Thanks, the behaviour changes look reasonable to me.

I haven't update the test because the hard-coded limit 10 makes it hard to write the tests. Any opinion of how to structure this?

I would suggest running most tests with HintMinLineLimit = 2 (and then have one test for the behaviour with HintMinLineLimit = 10).

To allow the tests to change HintMinLineLimit, we could give the inlayHints() function an optional parameter to specify it (could wrap it in an InlayHintOptions class for adding other options in the future).

Copy link
Collaborator

@HighCommander4 HighCommander4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(see previous comment)

HighCommander4 pushed a commit that referenced this pull request Apr 23, 2025
 * Only show for blocks 10 lines or taller (including braces)
 * Add parens for function call: "// if foo" -> "// if foo()" or "// if foo(...)"
 * Print literal nullptr
 * Escaping for abbreviated strings

Fixes clangd/clangd#1807.

Based on the original PR at #72345.

Co-authored-by: daiyousei-qz <[email protected]>
@HighCommander4
Copy link
Collaborator

Superseded by #136106.

llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request May 6, 2025
 * Only show for blocks 10 lines or taller (including braces)
 * Add parens for function call: "// if foo" -> "// if foo()" or "// if foo(...)"
 * Print literal nullptr
 * Escaping for abbreviated strings

Fixes clangd/clangd#1807.

Based on the original PR at llvm/llvm-project#72345.

Co-authored-by: daiyousei-qz <[email protected]>
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
 * Only show for blocks 10 lines or taller (including braces)
 * Add parens for function call: "// if foo" -> "// if foo()" or "// if foo(...)"
 * Print literal nullptr
 * Escaping for abbreviated strings

Fixes clangd/clangd#1807.

Based on the original PR at llvm#72345.

Co-authored-by: daiyousei-qz <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants