• 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

46.67
/plugin/common/src/main/java/com/perl5/lang/perl/psi/impl/PerlImplicitElement.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.navigation.ItemPresentation;
20
import com.intellij.psi.PsiElement;
21
import com.intellij.psi.PsiFile;
22
import com.intellij.psi.PsiManager;
23
import com.intellij.psi.impl.light.LightElement;
24
import com.perl5.lang.perl.PerlLanguage;
25
import com.perl5.lang.perl.idea.presentations.PerlItemPresentationSimple;
26
import org.jetbrains.annotations.NotNull;
27
import org.jetbrains.annotations.Nullable;
28

29
import java.util.Objects;
30

31
public abstract class PerlImplicitElement extends LightElement {
32
  private final @Nullable PsiElement myParent;
33

34

35
  public PerlImplicitElement(@NotNull PsiManager manager,
36
                             @Nullable PsiElement parent) {
37
    super(manager, PerlLanguage.INSTANCE);
1✔
38
    myParent = parent;
1✔
39
  }
1✔
40

41
  @Override
42
  public @Nullable PsiElement getParent() {
43
    return myParent;
1✔
44
  }
45

46
  @Override
47
  public int getTextOffset() {
48
    return getParent() == null ? 0 : getParent().getTextOffset();
×
49
  }
50

51
  @Override
52
  public @Nullable PsiFile getContainingFile() {
53
    PsiElement parent = getParent();
1✔
54
    return parent == null ? null : parent.getContainingFile();
1✔
55
  }
56

57
  @Override
58
  public ItemPresentation getPresentation() {
59
    return new PerlItemPresentationSimple(this, getName());
×
60
  }
61

62

63
  @Override
64
  public boolean equals(Object o) {
65
    if (this == o) {
×
66
      return true;
×
67
    }
68
    if (o == null || getClass() != o.getClass()) {
×
69
      return false;
×
70
    }
71

72
    PerlImplicitElement element = (PerlImplicitElement)o;
×
73

74
    return Objects.equals(myParent, element.myParent);
×
75
  }
76

77
  @Override
78
  public int hashCode() {
79
    return myParent != null ? myParent.hashCode() : 0;
1✔
80
  }
81
}
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