<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/140194>140194</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clangd autocomplete suggestion(s) for functions with explicit object parameter (deducing this) can be improved
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
arun5309
</td>
</tr>
</table>
<pre>
clangd's autocomplete suggestion(s) for functions with explicit object parameter (i.e deducing this) do not behave as expected. Here, is a simple example.
Current behavior:
```cpp
struct S {
void f(this auto& self) {}
};
int main() {
S s;
s. // Autocomplete suggestion (cursor after '.'): 'f(auto& self) method' which expands this line to 's.f(auto& self)' with cursor before ')'.
}
```
Expected behavior:
```cpp
struct S {
void f(this auto& self) {}
};
int main() {
S s;
s. // Autocomplete suggestion (cursor after '.'): 'f() method' which expands this line to 's.g()' with cursor after ')'.
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzcU81unjAQfJrlsgqC5cdw4ECSfuo9T2DMAq4AI9t8Sd--MtAfpemhUk-VkCzwzuzMLCud0-PK3EDxCMVzJHc_GdtIu69FltRRZ_qvjZrlOvZAwqHcvVFm2Wb2jG4fR3ZemxWockA1DsbisK8qfHP4qv2E_LbNWmmPpvvCyuMmrVzYs0WgSseMPfe70uuIftIHSW9wNR47nuSdUbpAwcpzH-Nntgz0hNqhRHQ6CEF-k-GMIWkhaZ92a3m94NpYyNrzAsrkfNS2QdI6b3fl8QVBPELSIt6N7nEAqoKOwyhQiY7nIYgKVeI50IhnyB5PSr16XKQO9r_XBKYXdGcJoosR6AZ0w_bj5EIKarfOWJTDmYqIgQRQDVkb3oKk92oW9pMJE8HXSasjZLn27ogQZ70yehOwLv4AfcDCaK6-HQ_GMl5NQ_vT5S-RnXY_XXP4v7L9uzzHE_E-wx_8f4ww6pusr7NaRtykIheZyItKRFNTpbLPqpyUSlU1lHnNdV6LJCdRpVXV5ZFuKKEiKdIyKfI6F3HZpfVQ1KkiKiWVAvKEF6nneJ7vS2zsGGnndm7SPEnrPJplx7M7Npxo5Vc8boEoLLxtAuih20cHeTJr591PGq_9zNf6_-vV_23tlVyxY9TLZs2d-2i3czN5v7nwlx1zHrWf9i5WZgG6BZHX8bBZExoA3Q5rDuh2eb839C0AAP__xtN_Jw">