Skip to content

Commit ec1e031

Browse files
committed
remove weak service warning #399
1 parent 84f1285 commit ec1e031

File tree

4 files changed

+21
-42
lines changed

4 files changed

+21
-42
lines changed

src/fr/adrienbrault/idea/symfony2plugin/Settings.java

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public class Settings implements PersistentStateComponent<Settings> {
5050

5151
public boolean phpAnnotateTemplate = true;
5252
public boolean phpAnnotateService = true;
53-
public boolean phpAnnotateWeakService = true;
5453
public boolean phpAnnotateRoute = true;
5554
public boolean phpAnnotateTemplateAnnotation = true;
5655
public boolean phpAnnotateTranslation = true;

src/fr/adrienbrault/idea/symfony2plugin/SettingsForm.form

+18-29
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
<rowspec value="center:max(d;4px):noGrow"/>
5353
<rowspec value="top:4dlu:noGrow"/>
5454
<rowspec value="center:max(d;4px):noGrow"/>
55-
<rowspec value="top:4dlu:noGrow"/>
56-
<rowspec value="center:max(d;4px):noGrow"/>
5755
<colspec value="fill:max(d;4px):noGrow"/>
5856
<colspec value="left:4dlu:noGrow"/>
5957
<colspec value="fill:d:grow"/>
@@ -202,18 +200,9 @@
202200
<text value="Template"/>
203201
</properties>
204202
</component>
205-
<component id="a28d6" class="javax.swing.JCheckBox" binding="phpAnnotateTemplateAnnotation">
206-
<constraints>
207-
<grid row="34" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
208-
<forms/>
209-
</constraints>
210-
<properties>
211-
<text value="Template Annotation"/>
212-
</properties>
213-
</component>
214203
<component id="93ec7" class="javax.swing.JLabel">
215204
<constraints>
216-
<grid row="38" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
205+
<grid row="36" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
217206
<forms/>
218207
</constraints>
219208
<properties>
@@ -222,7 +211,7 @@
222211
</component>
223212
<component id="42ded" class="javax.swing.JCheckBox" binding="yamlAnnotateServiceConfig">
224213
<constraints>
225-
<grid row="40" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
214+
<grid row="38" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
226215
<forms/>
227216
</constraints>
228217
<properties>
@@ -321,7 +310,7 @@
321310
</component>
322311
<component id="3cb6a" class="javax.swing.JLabel">
323312
<constraints>
324-
<grid row="42" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
313+
<grid row="40" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
325314
<forms/>
326315
</constraints>
327316
<properties>
@@ -330,22 +319,13 @@
330319
</component>
331320
<component id="57f0" class="javax.swing.JCheckBox" binding="highlightServices">
332321
<constraints>
333-
<grid row="44" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
322+
<grid row="42" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
334323
<forms/>
335324
</constraints>
336325
<properties>
337326
<text value="Highlight Services"/>
338327
</properties>
339328
</component>
340-
<component id="9e0bc" class="javax.swing.JCheckBox" binding="phpAnnotateTranslation">
341-
<constraints>
342-
<grid row="36" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
343-
<forms/>
344-
</constraints>
345-
<properties>
346-
<text value="Translation"/>
347-
</properties>
348-
</component>
349329
<component id="df4be" class="javax.swing.JLabel">
350330
<constraints>
351331
<grid row="10" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
@@ -418,22 +398,31 @@
418398
<text value="Translation"/>
419399
</properties>
420400
</component>
421-
<component id="acd72" class="javax.swing.JCheckBox" binding="phpAnnotateWeakService">
401+
<component id="c828d" class="javax.swing.JCheckBox" binding="codeFoldingTwigConstant">
402+
<constraints>
403+
<grid row="22" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
404+
<forms/>
405+
</constraints>
406+
<properties>
407+
<text value="Constant (Twig)"/>
408+
</properties>
409+
</component>
410+
<component id="a28d6" class="javax.swing.JCheckBox" binding="phpAnnotateTemplateAnnotation">
422411
<constraints>
423412
<grid row="32" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
424413
<forms/>
425414
</constraints>
426415
<properties>
427-
<text value="Weak Service"/>
416+
<text value="Template Annotation"/>
428417
</properties>
429418
</component>
430-
<component id="c828d" class="javax.swing.JCheckBox" binding="codeFoldingTwigConstant">
419+
<component id="9e0bc" class="javax.swing.JCheckBox" binding="phpAnnotateTranslation">
431420
<constraints>
432-
<grid row="22" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
421+
<grid row="34" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
433422
<forms/>
434423
</constraints>
435424
<properties>
436-
<text value="Constant (Twig)"/>
425+
<text value="Translation"/>
437426
</properties>
438427
</component>
439428
</children>

src/fr/adrienbrault/idea/symfony2plugin/SettingsForm.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ public class SettingsForm implements Configurable {
6767
private JCheckBox codeFoldingPhpTemplate;
6868
private JCheckBox codeFoldingTwigTemplate;
6969
private JCheckBox codeFoldingTwigConstant;
70-
71-
private JCheckBox phpAnnotateWeakService;
70+
7271
private JButton buttonReindex;
7372

7473
public SettingsForm(@NotNull final Project project) {
@@ -139,7 +138,6 @@ public boolean isModified() {
139138

140139
|| !phpAnnotateTemplate.isSelected() == getSettings().phpAnnotateTemplate
141140
|| !phpAnnotateService.isSelected() == getSettings().phpAnnotateService
142-
|| !phpAnnotateWeakService.isSelected() == getSettings().phpAnnotateWeakService
143141
|| !phpAnnotateRoute.isSelected() == getSettings().phpAnnotateRoute
144142
|| !phpAnnotateTemplateAnnotation.isSelected() == getSettings().phpAnnotateTemplateAnnotation
145143
|| !phpAnnotateTranslation.isSelected() == getSettings().phpAnnotateTranslation
@@ -180,7 +178,6 @@ public void apply() throws ConfigurationException {
180178

181179
getSettings().phpAnnotateTemplate = phpAnnotateTemplate.isSelected();
182180
getSettings().phpAnnotateService = phpAnnotateService.isSelected();
183-
getSettings().phpAnnotateWeakService = phpAnnotateWeakService.isSelected();
184181
getSettings().phpAnnotateRoute = phpAnnotateRoute.isSelected();
185182
getSettings().phpAnnotateTemplateAnnotation = phpAnnotateTemplateAnnotation.isSelected();
186183
getSettings().phpAnnotateTranslation = phpAnnotateTranslation.isSelected();
@@ -232,7 +229,6 @@ private void updateUIFromSettings() {
232229

233230
phpAnnotateTemplate.setSelected(getSettings().phpAnnotateTemplate);
234231
phpAnnotateService.setSelected(getSettings().phpAnnotateService);
235-
phpAnnotateWeakService.setSelected(getSettings().phpAnnotateWeakService);
236232
phpAnnotateRoute.setSelected(getSettings().phpAnnotateRoute);
237233
phpAnnotateTemplateAnnotation.setSelected(getSettings().phpAnnotateTemplateAnnotation);
238234
phpAnnotateTranslation.setSelected(getSettings().phpAnnotateTranslation);

src/fr/adrienbrault/idea/symfony2plugin/dic/PhpServiceAnnotator.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public void annotate(@NotNull final PsiElement element, @NotNull AnnotationHolde
2323
}
2424

2525
// nothing todo; no annotator enabled
26-
if(!Settings.getInstance(element.getProject()).phpAnnotateService && !Settings.getInstance(element.getProject()).phpAnnotateWeakService) {
26+
if(!Settings.getInstance(element.getProject()).phpAnnotateService) {
2727
return;
2828
}
2929

@@ -39,15 +39,10 @@ public void annotate(@NotNull final PsiElement element, @NotNull AnnotationHolde
3939

4040
ContainerService containerService = ContainerCollectionResolver.getService(element.getProject(), serviceName);
4141
if(containerService != null) {
42-
if(Settings.getInstance(element.getProject()).phpAnnotateWeakService && containerService.isWeak()) {
43-
holder.createWeakWarningAnnotation(element, "Weak Service");
44-
}
4542
return;
4643
}
4744

48-
if(Settings.getInstance(element.getProject()).phpAnnotateService) {
49-
holder.createWarningAnnotation(element, "Missing Service");
50-
}
45+
holder.createWarningAnnotation(element, "Missing Service");
5146

5247
}
5348
}

0 commit comments

Comments
 (0)