@@ -66,29 +66,7 @@ public class RequireJsIndex extends FileBasedIndexExtension<String, String> {
66
66
return map ;
67
67
}
68
68
parseConfigMap (map , config );
69
-
70
- final JSProperty pathsMap = config .findProperty ("paths" );
71
-
72
- if (pathsMap == null ) {
73
- return map ;
74
- }
75
- final JSObjectLiteralExpression [] pathGroupsWrappers = PsiTreeUtil
76
- .getChildrenOfType (pathsMap , JSObjectLiteralExpression .class );
77
-
78
- for (final JSObjectLiteralExpression pathGroupsWrapper : pathGroupsWrappers ) {
79
- final JSProperty [] allConfigs = pathGroupsWrapper .getProperties ();
80
-
81
- for (final JSProperty mapping : allConfigs ) {
82
- final String nameConfig = mapping .getName ();
83
- final JSExpression value = mapping .getValue ();
84
-
85
- if (value == null ) {
86
- continue ;
87
- }
88
- final String valueConfig = value .getText ();
89
- map .put (nameConfig , valueConfig );
90
- }
91
- }
69
+ parseConfigPaths (map , config );
92
70
}
93
71
}
94
72
@@ -105,11 +83,11 @@ private void parseConfigMap(
105
83
if (configMap == null ) {
106
84
return ;
107
85
}
108
-
109
86
final JSObjectLiteralExpression [] configGroupsWrappers = PsiTreeUtil .getChildrenOfType (
110
87
configMap ,
111
88
JSObjectLiteralExpression .class
112
89
);
90
+
113
91
for (final JSObjectLiteralExpression configGroupsWrapper : configGroupsWrappers ) {
114
92
final PsiElement [] configGroups = configGroupsWrapper .getChildren ();
115
93
@@ -134,6 +112,34 @@ private void parseConfigMap(
134
112
}
135
113
}
136
114
115
+ private void parseConfigPaths (
116
+ final Map <String , String > map ,
117
+ final JSObjectLiteralExpression config
118
+ ) {
119
+ final JSProperty pathsMap = config .findProperty ("paths" );
120
+
121
+ if (pathsMap == null ) {
122
+ return ;
123
+ }
124
+ final JSObjectLiteralExpression [] pathGroupsWrappers = PsiTreeUtil
125
+ .getChildrenOfType (pathsMap , JSObjectLiteralExpression .class );
126
+
127
+ for (final JSObjectLiteralExpression pathGroupsWrapper : pathGroupsWrappers ) {
128
+ final JSProperty [] allConfigs = pathGroupsWrapper .getProperties ();
129
+
130
+ for (final JSProperty mapping : allConfigs ) {
131
+ final String nameConfig = mapping .getName ();
132
+ final JSExpression value = mapping .getValue ();
133
+
134
+ if (value == null ) {
135
+ continue ;
136
+ }
137
+ final String valueConfig = value .getText ();
138
+ map .put (nameConfig , valueConfig );
139
+ }
140
+ }
141
+ }
142
+
137
143
@ Override
138
144
public @ NotNull KeyDescriptor <String > getKeyDescriptor () {
139
145
return new EnumeratorStringDescriptor ();
0 commit comments