Skip to content

Commit

Permalink
Enable folding of JS arrays and objects
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed May 29, 2020
1 parent fb69b07 commit 9392d4f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lang-javascript/src/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ export const javascriptSyntax = new LezerSyntax(parser.withProps(
return undefined
}),
foldNodeProp.add({
Block(tree: Subtree) { return {from: tree.start + 1, to: tree.end - 1} },
BlockComment(tree: Subtree) { return {from: tree.start + 2, to: tree.end - 2} }
Block(tree) { return {from: tree.start + 1, to: tree.end - 1} },
ObjectExpression(tree) { return {from: tree.start + 1, to: tree.end - 1} },
ArrayExpression(tree) { return {from: tree.start + 1, to: tree.end - 1} },
BlockComment(tree) { return {from: tree.start + 2, to: tree.end - 2} }
}),
styleTags({
"get set async static": "modifier",
Expand Down

0 comments on commit 9392d4f

Please sign in to comment.