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

Camelcade / Perl5-IDEA / #525521635

20 Jul 2025 03:45PM UTC coverage: 82.266% (-0.09%) from 82.355%
#525521635

push

github

hurricup
Build 252.23892.248

30936 of 37605 relevant lines covered (82.27%)

0.82 hits per line

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

62.5
/plugin/backend/src/main/java/com/perl5/lang/perl/idea/gotosearch/PerlGoToClassContributor.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.idea.gotosearch;
18

19
import com.intellij.navigation.GotoClassContributor;
20
import com.intellij.navigation.NavigationItem;
21
import com.intellij.openapi.project.Project;
22
import com.intellij.psi.search.GlobalSearchScope;
23
import com.perl5.lang.perl.psi.properties.PerlIdentifierOwner;
24
import com.perl5.lang.perl.util.PerlNamespaceUtil;
25
import com.perl5.lang.perl.util.PerlPackageUtil;
26
import com.perl5.lang.perl.util.PerlPackageUtilCore;
27
import org.jetbrains.annotations.NotNull;
28
import org.jetbrains.annotations.Nullable;
29

30
import java.util.Collection;
31
import java.util.Collections;
32

33
/**
34
 * GoToClassContributor looks up namespaces (packages names) - windows shortcut Ctrl+N
35
 */
36
public class PerlGoToClassContributor extends PerlChooseByNameContributor implements GotoClassContributor {
1✔
37
  @Override
38
  public @Nullable String getQualifiedName(@NotNull NavigationItem navigationItem) {
39
    return navigationItem instanceof PerlIdentifierOwner ? navigationItem.getName() : null;
×
40
  }
41

42
  @Override
43
  public @Nullable String getQualifiedNameSeparator() {
44
    return PerlPackageUtilCore.NAMESPACE_SEPARATOR;
×
45
  }
46

47
  @Override
48
  protected @NotNull Collection<String> getNamesCollection(Project project, boolean includeNonProjectItems) {
49
    return PerlPackageUtil.getKnownNamespaceNames(project);
1✔
50
  }
51

52
  @Override
53
  protected @NotNull Collection<? extends NavigationItem> getItemsCollectionByName(String packageName,
54
                                                                                   String pattern,
55
                                                                                   Project project,
56
                                                                                   boolean includeNonProjectItems) {
57
    if (PerlPackageUtilCore.MAIN_NAMESPACE_NAME.equals(packageName)) {
1✔
58
      return Collections.emptyList();
×
59
    }
60
    var searchScope = includeNonProjectItems ? GlobalSearchScope.allScope(project) : GlobalSearchScope.projectScope(project);
1✔
61
    return PerlNamespaceUtil.getNamespaceDefinitions(project, searchScope, packageName);
1✔
62
  }
63
}
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