From 89645555100c7c5a7c89f9d3ddc28f83a0d11078 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sat, 4 May 2024 07:17:00 +0000 Subject: [PATCH] Remove some 2020.1 compat code --- CHANGELOG.md | 4 ++++ .../nthykier/debpkg/deb822/Deb822FoldingBuilder.java | 7 ++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a30ad4..4814bf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ value. This means that the value will still be rendered in its proper syntax coloring rather than in the "folded" coloring. (Closes: #159) +### Changed + +- Internal/Chore: Replace some compat code now that we no longer support IDEA 2020.1. + ## 0.0.23 - 2024-04-06 ### Added diff --git a/src/main/java/com/github/nthykier/debpkg/deb822/Deb822FoldingBuilder.java b/src/main/java/com/github/nthykier/debpkg/deb822/Deb822FoldingBuilder.java index 2f5ad17..fde889c 100644 --- a/src/main/java/com/github/nthykier/debpkg/deb822/Deb822FoldingBuilder.java +++ b/src/main/java/com/github/nthykier/debpkg/deb822/Deb822FoldingBuilder.java @@ -158,11 +158,8 @@ public boolean isCollapsedByDefault(@NotNull ASTNode node) { private static void processComments(PsiElement root, List descriptors) { List comments = new ArrayList<>(); - // Use (root, PsiComment.class, ...) when 201 compat can be dropped. - PsiTreeUtil.processElements(root, e -> { - if (e instanceof PsiComment) { - comments.add((PsiComment)e); - } + PsiTreeUtil.processElements(root, PsiComment.class, e -> { + comments.add(e); return true; }); PsiComment currentStart = null;