• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Camelcade / Perl5-IDEA / #525521660

24 Aug 2025 01:28PM UTC coverage: 75.89% (-6.3%) from 82.227%
#525521660

push

github

hurricup
Migrated coverage reporting to https://github.com/nbaztec/coveralls-jacoco-gradle-plugin

See: https://github.com/kt3k/coveralls-gradle-plugin/issues/119

14751 of 22639 branches covered (65.16%)

Branch coverage included in aggregate %.

31091 of 37767 relevant lines covered (82.32%)

0.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.14
/plugin/common/src/main/java/com/perl5/lang/perl/parser/elementTypes/PerlCodeBlockElementType.java
1
/*
2
 * Copyright 2015-2025 Alexandr Evstigneev
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package com.perl5.lang.perl.parser.elementTypes;
18

19
import com.intellij.lang.ASTNode;
20
import com.intellij.psi.tree.IElementType;
21
import com.intellij.psi.util.PsiUtilCore;
22
import com.perl5.lang.perl.lexer.PerlLexer;
23
import com.perl5.lang.perl.lexer.PerlTemplatingLexer;
24
import org.jetbrains.annotations.NotNull;
25

26
import static com.perl5.lang.perl.parser.PerlElementTypesGenerated.*;
27

28

29
public class PerlCodeBlockElementType extends PerlBracedBlockElementType {
30

31
  public PerlCodeBlockElementType() {
32
    super("BLOCK");
1✔
33
  }
1✔
34

35
  @Override
36
  protected @NotNull IElementType getOpeningBraceType() {
37
    return LEFT_BRACE;
1!
38
  }
39

40
  @Override
41
  protected boolean isLexerStateOk(int lexerState) {
42
    return PerlTemplatingLexer.getPerlLexerState(lexerState) == PerlLexer.AFTER_RIGHT_BRACE;
1!
43
  }
44

45
  @Override
46
  protected boolean isParentOk(@NotNull ASTNode parent) {
47
    if (!super.isParentOk(parent)) {
1!
48
      return false;
×
49
    }
50

51
    IElementType parentType = PsiUtilCore.getElementType(parent);
1✔
52

53
    // block and file level block, may turn to the hash
54
    if (parentType == BLOCK_COMPOUND) {
1✔
55
      return false;
1✔
56
    }
57

58
    IElementType firstChildType = PsiUtilCore.getElementType(parent.getFirstChildNode());
1✔
59

60
    // moving up to call arguments
61
    if (parentType == COMMA_SEQUENCE_EXPR) {
1✔
62
      parent = parent.getTreeParent();
1✔
63
      parentType = PsiUtilCore.getElementType(parent);
1✔
64
    }
65

66
    return parentType != CALL_ARGUMENTS || firstChildType != this;
1!
67
  }
68
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc