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

Camelcade / Perl5-IDEA / #525521650

25 Jul 2025 09:58AM UTC coverage: 82.196% (-0.09%) from 82.289%
#525521650

push

github

hurricup
Migrated module packaging to pluginModule

30956 of 37661 relevant lines covered (82.2%)

0.82 hits per line

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

53.85
/plugin/common/src/main/java/com/perl5/lang/perl/psi/impl/PerlImplicitNamespaceDefinition.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.psi.impl;
18

19
import com.intellij.psi.PsiElement;
20
import com.intellij.psi.PsiManager;
21
import com.intellij.util.IncorrectOperationException;
22
import com.perl5.PerlIcons;
23
import com.perl5.lang.perl.psi.PerlNamespaceDefinitionWithIdentifier;
24
import com.perl5.lang.perl.psi.PerlNamespaceElement;
25
import com.perl5.lang.perl.psi.mro.PerlMroType;
26
import com.perl5.lang.perl.psi.utils.PerlNamespaceAnnotations;
27
import com.perl5.lang.perl.util.PerlPackageUtilCore;
28
import org.jetbrains.annotations.NotNull;
29
import org.jetbrains.annotations.Nullable;
30

31
import javax.swing.*;
32
import java.util.Collections;
33
import java.util.List;
34
import java.util.Map;
35

36
public class PerlImplicitNamespaceDefinition extends PerlImplicitElement implements PerlNamespaceDefinitionWithIdentifier {
37
  private final @NotNull String myNamespaceName;
38

39
  public PerlImplicitNamespaceDefinition(@NotNull PsiManager manager,
40
                                         @NotNull String namespaceName,
41
                                         @Nullable PsiElement parent) {
42
    super(manager, parent);
1✔
43
    myNamespaceName = PerlPackageUtilCore.getCanonicalNamespaceName(namespaceName);
1✔
44
  }
1✔
45

46
  @Override
47
  public String toString() {
48
    return "Implicit namespace: " + getPresentableName();
1✔
49
  }
50

51
  @Override
52
  public @NotNull PerlMroType getMroType() {
53
    return PerlMroType.DFS;
×
54
  }
55

56
  @Override
57
  public String getName() {
58
    return getNamespaceName();
1✔
59
  }
60

61
  @Override
62
  public @NotNull String getNamespaceName() {
63
    return myNamespaceName;
1✔
64
  }
65

66
  @Override
67
  public @Nullable Icon getIcon(int flags) {
68
    return PerlIcons.PACKAGE_GUTTER_ICON;
1✔
69
  }
70

71
  @Override
72
  public @NotNull List<String> getParentNamespacesNames() {
73
    return Collections.emptyList();
×
74
  }
75

76
  @Override
77
  public @Nullable PerlNamespaceAnnotations getAnnotations() {
78
    return null;
×
79
  }
80

81
  @Override
82
  public @NotNull List<String> getEXPORT() {
83
    return Collections.emptyList();
×
84
  }
85

86
  @Override
87
  public @NotNull List<String> getEXPORT_OK() {
88
    return Collections.emptyList();
×
89
  }
90

91
  @Override
92
  public @NotNull Map<String, List<String>> getEXPORT_TAGS() {
93
    return Collections.emptyMap();
×
94
  }
95

96
  @Override
97
  public boolean equals(Object o) {
98
    if (this == o) {
1✔
99
      return true;
1✔
100
    }
101
    if (!(o instanceof PerlImplicitNamespaceDefinition that)) {
1✔
102
      return false;
1✔
103
    }
104
    if (!super.equals(o)) {
×
105
      return false;
×
106
    }
107

108
    return getNamespaceName().equals(that.getNamespaceName());
×
109
  }
110

111
  @Override
112
  public int hashCode() {
113
    int result = super.hashCode();
1✔
114
    result = 31 * result + getNamespaceName().hashCode();
1✔
115
    return result;
1✔
116
  }
117

118
  @Override
119
  public @Nullable PsiElement getNameIdentifier() {
120
    return null;
×
121
  }
122

123
  @Override
124
  public PsiElement setName(@NotNull String name) throws IncorrectOperationException {
125
    return this;
×
126
  }
127

128
  @Override
129
  public @Nullable PerlNamespaceElement getNamespaceElement() {
130
    return null;
×
131
  }
132
}
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