We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4ef0ebc + 61d9e8f commit 73f2105Copy full SHA for 73f2105
src/components/UASTViewer.js
@@ -13,7 +13,13 @@ export const getSearchResults = uast => {
13
return null;
14
}
15
16
- if (Array.isArray(rootNode.n)) {
+ // for search server returns [result, result, result]
17
+ // in case when all the results are nodes we can ignore wrapper node
18
+ // and display only results for better UI/UX.
19
+ //
20
+ // for values (strings, ints, bool) we have to keep the wrapping node
21
+ // otherwise it's not a tree and uast-viewer wouldn't be able to display it
22
+ if (Array.isArray(rootNode.n) && rootNode.n.every(c => c.id !== undefined)) {
23
return rootNode.n.map(c => c.id);
24
25
0 commit comments