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

Camelcade / Perl5-IDEA / #525521639

21 Jul 2025 03:09PM UTC coverage: 82.304% (-0.04%) from 82.347%
#525521639

push

github

hurricup
#2842 Moved MasonFoldingBuilder to the common

68 of 98 new or added lines in 14 files covered. (69.39%)

67 existing lines in 12 files now uncovered.

30962 of 37619 relevant lines covered (82.3%)

0.82 hits per line

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

89.47
/mason/mason2/common/src/main/java/com/perl5/lang/mason2/psi/impl/MasonNamespaceDefinitionImpl.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.mason2.psi.impl;
18

19
import com.intellij.lang.ASTNode;
20
import com.intellij.psi.tree.IElementType;
21
import com.perl5.lang.htmlmason.MasonCoreUtilCore;
22
import com.perl5.lang.mason2.idea.configuration.MasonSettings;
23
import com.perl5.lang.mason2.psi.MasonNamespaceDefinition;
24
import com.perl5.lang.perl.psi.PerlNamespaceElement;
25
import com.perl5.lang.perl.psi.PerlVariableDeclarationElement;
26
import com.perl5.lang.perl.psi.impl.PsiPerlNamespaceDefinitionImpl;
27
import com.perl5.lang.perl.psi.stubs.namespaces.PerlNamespaceDefinitionStub;
28
import org.jetbrains.annotations.NotNull;
29
import org.jetbrains.annotations.Nullable;
30

31
import java.util.ArrayList;
32
import java.util.List;
33

34
public class MasonNamespaceDefinitionImpl extends PsiPerlNamespaceDefinitionImpl implements MasonNamespaceDefinition {
35
  protected List<PerlVariableDeclarationElement> myImplicitVariables = null;
1✔
36
  protected int mySettingsChangeCounter;
37

38
  public MasonNamespaceDefinitionImpl(ASTNode node) {
39
    super(node);
1✔
40
  }
1✔
41

42
  public MasonNamespaceDefinitionImpl(PerlNamespaceDefinitionStub stub, IElementType nodeType) {
43
    super(stub, nodeType);
1✔
44
  }
1✔
45

46
  protected @NotNull List<PerlVariableDeclarationElement> buildImplicitVariables(MasonSettings masonSettings) {
47
    List<PerlVariableDeclarationElement> newImplicitVariables = new ArrayList<>();
1✔
48

49
    if (isValid()) {
1✔
50
      MasonCoreUtilCore.fillVariablesList(this, newImplicitVariables, masonSettings.globalVariables);
1✔
51
    }
52
    return newImplicitVariables;
1✔
53
  }
54

55
  @Override
56
  public PerlNamespaceElement getNamespaceElement() {
57
    return null;
1✔
58
  }
59

60
  @Override
61
  public @Nullable String getNamespaceName() {
62
    return MasonNamespaceDefinitionService.getInstance().getNamespaceName(this);
1✔
63
  }
64

65
  @Override
66
  protected @Nullable String computeNamespaceName() {
NEW
67
    return MasonNamespaceDefinitionService.getInstance().computeNamespaceName(this);
×
68
  }
69

70
  @Override
71
  public @Nullable String getPresentableName() {
NEW
72
    return MasonNamespaceDefinitionService.getInstance().getPresentableName(this);
×
73
  }
74

75
  @Override
76
  public @NotNull MasonFileImpl getContainingFile() {
77
    return (MasonFileImpl)super.getContainingFile();
1✔
78
  }
79

80
  @Override
81
  public @NotNull List<PerlVariableDeclarationElement> getImplicitVariables() {
82
    MasonSettings settings = MasonSettings.getInstance(getProject());
1✔
83
    if (myImplicitVariables == null || mySettingsChangeCounter != settings.getChangeCounter()) {
1✔
84
      myImplicitVariables = buildImplicitVariables(settings);
1✔
85
      mySettingsChangeCounter = settings.getChangeCounter();
1✔
86
    }
87
    return myImplicitVariables;
1✔
88
  }
89
}
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