Skip to content

Commit 5bddea9

Browse files
authored
Merge pull request #1451 from Haehnchen/feature/tags-service-yml
add support for service class inside tag adding indention
2 parents 2755d53 + 5407780 commit 5bddea9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

+11-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,17 @@ public String getText() {
149149
private static Pair<PhpClass, Set<String>> invoke(@NotNull Project project, @NotNull YAMLKeyValue serviceKeyValue) {
150150

151151
String aClass = YamlHelper.getYamlKeyValueAsString(serviceKeyValue, "class");
152-
if(aClass == null|| StringUtils.isBlank(aClass)) {
152+
if(aClass == null || StringUtils.isBlank(aClass)) {
153+
PsiElement key = serviceKeyValue.getKey();
154+
if (key != null) {
155+
String text = key.getText();
156+
if (StringUtils.isNotBlank(text) && YamlHelper.isClassServiceId(text)) {
157+
aClass = text;
158+
}
159+
}
160+
}
161+
162+
if(aClass == null) {
153163
return null;
154164
}
155165

0 commit comments

Comments
 (0)