Issue 129448
Summary [clangd] Show Value on hover for objects representable at constexpr
Labels new issue
Assignees
Reporter torshepherd
    Currently, hovers on basic values like `const char*` display their constexpr value:

![Image](https://github.com/user-attachments/assets/09463151-165c-4516-bd4f-548a6320e992)

However, hovers on structs and other objects don't show a value:

![Image](https://github.com/user-attachments/assets/e5fb70de-4810-430b-9721-a2a514d3afc7)

They _could_ feasibly use one of three strategies for displaying a value:

1. Do the same thing that P2741R3 does; if the type has .data() and .size() methods, treat it as a way to display the values and use them to render characters in the hover.
2.  if the type has a constexpr ostream operator, constexpr formatter specialization, etc. use that.
3. __builtin_dump_struct or similar method of displaying the fields

I think #1 is the cleanest, and as more things become possible at constexpr this could be useful for debugging constexpr code more easily.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to