<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61482>61482</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang][ExtractAPI] Declaration fragments for TagDecl types defined in a typedef is incomplete
</td>
</tr>
<tr>
<th>Labels</th>
<td>
good first issue,
clang:tooling
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
daniel-grumberg
</td>
</tr>
</table>
<pre>
enums and structs declared inside typedefs have incorrect declaration fragments, where the typedef keyword and other syntax is missing.
For the following struct:
```obj-c
typedef struct Test {
int hello;
} Test;
```
The produced declaration is:
```json
"declarationFragments": [
{
"kind": "keyword",
"spelling": "struct"
},
{
"kind": "text",
"spelling": " "
},
{
"kind": "identifier",
"spelling": "Test"
}
],
```
instead the declaration fragments should represent the following
```obj-c
typedef struct Test {
…
} Test;
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVMFuozAQ_RpzGSWCcQjhwCEtjbS3PfQHDB7ArbEj27TN369iSJNI3d1qV4qCNH4zbzxv_IT3qjdEFcsfWF4nYgqDdZUURpFe9W4aG3J90lh5qshMowdhJPjgpjZ4kNRq4UiCMl5JgnA6kqTOwyDeCJRprXPUhgUngrIGOif6kUzwDB_hfSBHEIbPVHil07t1MtLYMJADfzJBfIDyMCrvlenXLK1Zup__D9bF_M5qbd-V6ZfmGN_fwtg2nX-2eVm1c-xCOSfAM_kArHiYDwEAlAkwkNaW8SXKijriroFL3Vuy54Hg6KycWpJ3d1f-d229eGuWEOJNyuE6LWR8D2eZlv7uWmWIr8rICwpxmeM5gI93OH8krZXpr9hlYojX0vVN1p-JAn2Eb7HAPxIoSSaoTpH7Fk2U555pnmt-pfxSNWV8ICHjNn25sOAHO2kJjo6OPJlwv3j_sWjsCdkuZfvt37YskRWXJS9FQlW2Lcq0SAuOyVBlu6ZEygpelLLY7QS2WPJcZII3HYmiTFSFKfKUZ0W25ZjhuhMpb7uOy5ZvqMwztklpFEqvtX4b19b1ifJ-omqbbXaYaNGQ9tElEHtrJXTK-QARs-iC2Gphesb3wdqLKHmduOpcctVMvWebVCsf_JUkqKCj-8y5ec3yh6eP4EQb9j9_sLyG-kstOuvgWfTnw-gdZzPqlIleBOLTTpSPNjQeNQVKJqerIYRjfIZ4YHjoVRimZt3akeHh3NTyWR2dfaHzozjEK3qGhziJXwEAAP__3D6Iyw">