`getChildrenOfKind` does not work for `StringLiteral`
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 238
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
**Describe the bug**
Hi,
`getChildrenOfKind` returns nothing for `SyntaxKind.StringLiteral` because `useParseTreeSearchForKind` returns `false` which should be `true`.
Version: 25.0.1
**To Reproduce**
```javascript
import { Project, SyntaxKind } from 'ts-morph';
const src = '["abc", "def"];';
const project = new Project();
const source = project.createSourceFile('dummy.js', src);
for (const es of source.getChildrenOfKind(SyntaxKind.ExpressionStatement)) {
for (const ale of es.getChildrenOfKind(SyntaxKind.ArrayLiteralExpression)) {
for (const sl of ale.getChildrenOfKind(SyntaxKind.StringLiteral)) {
console.log(sl); // not found
}
for (const sl of ale._getCompilerForEachChildren().filter((c) => c.kind === SyntaxKind.StringLiteral)) {
console.log(sl); // found
}
}
}
```
**Expected behavior**
`getChildrenOfKind` returns the children of `StringLiteral`.
Contributor guide
Assessment
This issue has not been assessed yet.