Skip to content

Commit cfa650a

Browse files
committed
Move fix for YamlServiceArgumentInspection out of awt event
Fixes: Haehnchen#1037 Fixes: Haehnchen#993 Fixes: Haehnchen#1184
1 parent b8008cd commit cfa650a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/fr/adrienbrault/idea/symfony2plugin/intentions/yaml/YamlServiceArgumentInspection.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package fr.adrienbrault.idea.symfony2plugin.intentions.yaml;
22

33
import com.intellij.codeInspection.*;
4+
import com.intellij.openapi.command.WriteCommandAction;
45
import com.intellij.openapi.project.Project;
56
import com.intellij.psi.PsiElement;
67
import com.intellij.psi.PsiElementVisitor;
@@ -131,9 +132,13 @@ public String getFamilyName() {
131132
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor problemDescriptor) {
132133
final PsiElement serviceKeyValue = problemDescriptor.getPsiElement().getParent();
133134

134-
if(serviceKeyValue instanceof YAMLKeyValue) {
135-
ServiceActionUtil.fixServiceArgument((YAMLKeyValue) serviceKeyValue);
135+
if(!(serviceKeyValue instanceof YAMLKeyValue)) {
136+
return;
136137
}
138+
139+
WriteCommandAction.writeCommandAction(project).withName("Service Update").run(() -> {
140+
ServiceActionUtil.fixServiceArgument((YAMLKeyValue) serviceKeyValue);
141+
});
137142
}
138143
}
139144
}

0 commit comments

Comments
 (0)