-
-
Notifications
You must be signed in to change notification settings - Fork 140
Added service name reference contributor for YAML DIC files #1919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a2aeb5f
to
a861cb0
Compare
src/main/java/fr/adrienbrault/idea/symfony2plugin/config/ServiceReference.java
Outdated
Show resolved
Hide resolved
a94c5bb
to
f105c81
Compare
...ava/fr/adrienbrault/idea/symfony2plugin/tests/dic/yaml/YamlDicCompletionContributorTest.java
Show resolved
Hide resolved
PlatformPatterns | ||
.psiElement(YAMLScalar.class) | ||
.withParent( | ||
PlatformPatterns | ||
.psiElement(YAMLSequenceItem.class) | ||
.withParent( | ||
PlatformPatterns | ||
.psiElement(YAMLSequence.class) | ||
.withParent( | ||
PlatformPatterns | ||
.psiElement(YAMLKeyValue.class) | ||
.withParent( | ||
PlatformPatterns | ||
.psiElement(YAMLMapping.class) | ||
.withParent( | ||
PlatformPatterns | ||
.psiElement(YAMLSequenceItem.class) | ||
.withParent( | ||
PlatformPatterns | ||
.psiElement(YAMLSequence.class) | ||
.withParent( | ||
PlatformPatterns | ||
.psiElement(YAMLKeyValue.class) | ||
.withName("calls") | ||
) | ||
) | ||
) | ||
) | ||
|
||
) | ||
) | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any suggestion how this could be simplified will be more the welcome 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as long as its tested its fine, thats how its nested :)
i also have no idea to simplify this.
c4e0d12
to
595899b
Compare
595899b
to
d7281c2
Compare
PR is now ready for code review @Haehnchen 😉 |
assertReferenceMatchOnParent( | ||
YAMLFileType.YML, | ||
"services:\n" + | ||
" app.service.bar:\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are keys not supported by references provider?
so that we can provide support for this also later:
App\\BarService: ~
App\\BarService:
arguments:
$test: "%foobar%"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for feedback!
are keys not supported by references provider?
No. I planned to work on this in separate PR. Work in progress branch: https://github.com/Haehnchen/idea-php-symfony2-plugin/compare/master...adamwojs:class_fqn_ref_provider?expand=1
Case when service name is FQCN is a little bit more tricky. What I would expect as Symfony user is that whenever class/namespace is renamed the service name and it's references are updated. This would be a huge time saver.
Good idea with parameters references 👍
👍 |
This PR brings support for service references detection over the YAML based dependency injection container configuration files. In practice this allows to:
References are detected in: