Skip to content

Commit

Permalink
feat: fold class body
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Oct 18, 2023
1 parent ed2712a commit b0e4b8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Changed

- Fix store static field
- Fold class body

## [0.1.3] - 2023-10-17

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import com.intellij.openapi.editor.Document
import com.intellij.openapi.project.DumbAware
import com.intellij.psi.PsiElement
import com.intellij.psi.SyntaxTraverser
import pascal.taie.intellij.tir.syntax.psi.TirClassBody
import pascal.taie.intellij.tir.syntax.psi.TirMethodBody

class TirFoldingBuilder : FoldingBuilderEx(), DumbAware {
override fun buildFoldRegions(
root: PsiElement, document: Document, quick: Boolean
) = SyntaxTraverser
.psiTraverser(root)
.filter { it is TirMethodBody }
.filter { it is TirMethodBody || it is TirClassBody }
.map { TirFoldingDescriptor(it, "{…}") }
.toList().toTypedArray()

Expand Down

0 comments on commit b0e4b8e

Please sign in to comment.