@@ -40,37 +40,37 @@ public class RequireJsIndex extends FileBasedIndexExtension<String, String> {
40
40
@ Override
41
41
public @ NotNull DataIndexer <String , String , FileContent > getIndexer () {
42
42
return inputData -> {
43
- Map <String , String > map = new HashMap <>();
44
- JSFile jsFile = (JSFile ) inputData .getPsiFile ();
43
+ final Map <String , String > map = new HashMap <>();
44
+ final JSFile jsFile = (JSFile ) inputData .getPsiFile ();
45
45
46
- JSVarStatement jsVarStatement = PsiTreeUtil .getChildOfType (jsFile , JSVarStatement .class );
46
+ final JSVarStatement jsVarStatement = PsiTreeUtil .getChildOfType (jsFile , JSVarStatement .class );
47
47
if (jsVarStatement == null ) {
48
48
return map ;
49
49
}
50
- JSVariable [] jsVariableList = jsVarStatement .getVariables ();
51
- for (JSVariable jsVariable : jsVariableList ) {
52
- String name = jsVariable .getName ();
50
+ final JSVariable [] jsVariableList = jsVarStatement .getVariables ();
51
+ for (final JSVariable jsVariable : jsVariableList ) {
52
+ final String name = jsVariable .getName ();
53
53
if (name .equals ("config" )) {
54
- JSObjectLiteralExpression config = PsiTreeUtil .getChildOfType (jsVariable , JSObjectLiteralExpression .class );
54
+ final JSObjectLiteralExpression config = PsiTreeUtil .getChildOfType (jsVariable , JSObjectLiteralExpression .class );
55
55
if (config == null ) {
56
56
return map ;
57
57
}
58
58
parseConfigMap (map , config );
59
59
60
- JSProperty pathsMap = config .findProperty ("paths" );
60
+ final JSProperty pathsMap = config .findProperty ("paths" );
61
61
if (pathsMap == null ) {
62
62
return map ;
63
63
}
64
- JSObjectLiteralExpression [] pathGroupsWrappers = PsiTreeUtil .getChildrenOfType (pathsMap , JSObjectLiteralExpression .class );
65
- for (JSObjectLiteralExpression pathGroupsWrapper : pathGroupsWrappers ) {
66
- JSProperty [] allConfigs = pathGroupsWrapper .getProperties ();
67
- for (JSProperty mapping : allConfigs ) {
68
- String nameConfig = mapping .getName ();
69
- JSExpression value = mapping .getValue ();
64
+ final JSObjectLiteralExpression [] pathGroupsWrappers = PsiTreeUtil .getChildrenOfType (pathsMap , JSObjectLiteralExpression .class );
65
+ for (final JSObjectLiteralExpression pathGroupsWrapper : pathGroupsWrappers ) {
66
+ final JSProperty [] allConfigs = pathGroupsWrapper .getProperties ();
67
+ for (final JSProperty mapping : allConfigs ) {
68
+ final String nameConfig = mapping .getName ();
69
+ final JSExpression value = mapping .getValue ();
70
70
if (value == null ) {
71
71
continue ;
72
72
}
73
- String valueConfig = value .getText ();
73
+ final String valueConfig = value .getText ();
74
74
map .put (nameConfig , valueConfig );
75
75
}
76
76
}
@@ -85,26 +85,26 @@ private void parseConfigMap(
85
85
final Map <String , String > map ,
86
86
final JSObjectLiteralExpression config
87
87
) {
88
- JSProperty configMap = config .findProperty ("map" );
88
+ final JSProperty configMap = config .findProperty ("map" );
89
89
if (configMap == null ) {
90
90
return ;
91
91
}
92
92
93
- JSObjectLiteralExpression [] configGroupsWrappers = PsiTreeUtil .getChildrenOfType (configMap , JSObjectLiteralExpression .class );
94
- for (JSObjectLiteralExpression configGroupsWrapper : configGroupsWrappers ) {
95
- PsiElement [] configGroups = configGroupsWrapper .getChildren ();
93
+ final JSObjectLiteralExpression [] configGroupsWrappers = PsiTreeUtil .getChildrenOfType (configMap , JSObjectLiteralExpression .class );
94
+ for (final JSObjectLiteralExpression configGroupsWrapper : configGroupsWrappers ) {
95
+ final PsiElement [] configGroups = configGroupsWrapper .getChildren ();
96
96
97
- for (PsiElement configGroup : configGroups ) {
98
- JSObjectLiteralExpression mappingWrapper = PsiTreeUtil .getChildOfType (configGroup , JSObjectLiteralExpression .class );
99
- JSProperty [] allConfigs = mappingWrapper .getProperties ();
97
+ for (final PsiElement configGroup : configGroups ) {
98
+ final JSObjectLiteralExpression mappingWrapper = PsiTreeUtil .getChildOfType (configGroup , JSObjectLiteralExpression .class );
99
+ final JSProperty [] allConfigs = mappingWrapper .getProperties ();
100
100
101
- for (JSProperty mapping : allConfigs ) {
102
- String nameConfig = mapping .getName ();
103
- JSExpression value = mapping .getValue ();
101
+ for (final JSProperty mapping : allConfigs ) {
102
+ final String nameConfig = mapping .getName ();
103
+ final JSExpression value = mapping .getValue ();
104
104
if (value == null ) {
105
105
continue ;
106
106
}
107
- String valueConfig = value .getText ();
107
+ final String valueConfig = value .getText ();
108
108
map .put (nameConfig , valueConfig );
109
109
}
110
110
}
0 commit comments