<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/90027>90027</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Add a fixit for inserting the matching closing brace
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
andre-hartmann
</td>
</tr>
</table>
<pre>
This request was posted as [clangd #2022](https://github.com/clangd/clangd/issues/2022) first, after being reported as [QTCREATORBUG-30732](https://bugreports.qt.io/browse/QTCREATORBUG-30732)
Consider the following C code:
```
#include <string.h>
static char GlobalVariable[64];
int main()
{
strcpy(GlabalVariable, "Hello World");
strcpy(GlobalVariable, "Hello World";
return 0;
}
```
For the first errornous line we get a fixit (light bulb) to rename the variable and the following tooltip:
```
main.c:7:12: Use of undeclared identifier 'GlabalVariable'; did you mean 'GlobalVariable'? (fix available)
main.c:3:13: 'GlobalVariable' declared here
```
but for the second there is only a Clangd error that says a closing brace is missing at column 41:
```
main.c:8:41: Expected ')'
main.c:8:11: to match this '('
```
It would be cool to have fixits for the second kind of errors too.
This is how it looks in Qt Creator:
![325283164-22dd8356-343a-463a-ad27-5e6eceeb3bd5](https://github.com/llvm/llvm-project/assets/23051867/516761fb-5489-46b5-b027-c646e0bd952b)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVUtzIjcQ_jXi0jWURprngQPgxckptVve5KxHD6OskFhJY-x_n9IMwQ5xypUqSiDxdevrrx8SMZqjQ9yQekfqh5WY0ujDRjgdsBhFSCfh3Ep6_bp5Gk2EgD8njAkuIsLZx4QaRARS75QV7qiBMM4oY6R-IKwbUzpHwreEHQg7HE0aJ7lW_kTYYYG__2FinDASdpjtWQ-DCTERtgcxJAwg0bgjBDz78Hbr16f9ty_bp9--7b4_Fpy2_MOb5XRc7OL6Z1obn4-Cv0Qk7PCBB9YT-kDodln33kWjMUAaEQZvrb9k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