@@ -47,16 +47,19 @@ public class ApiSearchContributor implements WeightedSearchEverywhereContributor
4747
4848 private final AnActionEvent actionEvent ;
4949 private final Project myProject ;
50- private final PersistentSearchEverywhereContributorFilter <HttpMethod > myFilter ;
50+ private PersistentSearchEverywhereContributorFilter <HttpMethod > myFilter ;
5151 private List <ApiNavigationItem > navItemList ;
5252
5353 public ApiSearchContributor (@ NotNull AnActionEvent event ) {
5454 this .actionEvent = event ;
5555 myProject = event .getRequiredData (CommonDataKeys .PROJECT );
56- myFilter = new PersistentSearchEverywhereContributorFilter <>(
57- Arrays .asList (HttpMethod .values ()), MethodFilterConfiguration .getInstance (myProject ),
58- Enum ::name , httpMethod -> null
59- );
56+ MethodFilterConfiguration methodFilterConfiguration = MethodFilterConfiguration .getInstance (myProject );
57+ if (methodFilterConfiguration != null ) {
58+ myFilter = new PersistentSearchEverywhereContributorFilter <>(
59+ Arrays .asList (HttpMethod .values ()), methodFilterConfiguration ,
60+ Enum ::name , httpMethod -> null
61+ );
62+ }
6063 }
6164
6265 @ NotNull
@@ -163,7 +166,12 @@ public void fetchWeightedElements(@NotNull String pattern, @NotNull ProgressIndi
163166 }
164167
165168 MinusculeMatcher matcher = NameUtil .buildMatcher ("*" + pattern + "*" , NameUtil .MatchingCaseSensitivity .NONE );
166- Set <HttpMethod > httpMethodSet = new HashSet <>(myFilter .getSelectedElements ());
169+ Set <HttpMethod > httpMethodSet = new HashSet <>();
170+ if (myFilter == null ) {
171+ httpMethodSet .addAll (Arrays .asList (HttpMethod .values ()));
172+ } else {
173+ httpMethodSet .addAll (myFilter .getSelectedElements ());
174+ }
167175 boolean selectAll = httpMethodSet .size () == HttpMethod .values ().length ;
168176
169177 // 从ALL -> URL Tab或快捷键进入时列表为空
0 commit comments