Issue 130571
Summary Add inlay hints for default arguments
Labels clangd
Assignees
Reporter ilya-biryukov
    It would be great to show default arguments in various places through inlay hints.

Right now, only parameter names are shown in calls:
![Image](https://github.com/user-attachments/assets/cf7ac0ab-98fb-496f-8ccf-cf578e40b408)

It would definitely be great if one could also see the default arguments from declarations on the definition and use sites (comments below mark inlay hints I'm proposing to add):
```cpp
void foo(int a = 10);
void foo(int a /* = 10*/) {
}

void test() {
  foo(/*10*/)
}
```

Going a bit further, we could also consider adding inlay hints for default arguments, although they look like a harder sell to me because I expect more noise (e.g. `unique_ptr` has a default deleter, `vector` has an allocator and `unordered_map` have hash defaults that are going to be popping up everywhere):

```cpp
template <class T = int>
struct Foo {
};

Foo</*int*/> x;
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to