-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Language injection for CSS, XPath, JSON and DQL #1301
Conversation
I did test the feature locally in 2018.3, 2019.1 and 2019.1.1 Preview |
(Edit: I rethought this and think it's not very common to have |
@@ -611,6 +613,7 @@ | |||
<depends>org.jetbrains.plugins.yaml</depends> | |||
<depends>de.espend.idea.php.annotation</depends> | |||
|
|||
<depends optional="true">com.jetbrains.php.dql</depends> |
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.
I think we should make the DQL plugin mandatory. Both from a usability POV, but also because we dont currently check whether the plugin is installed. WDYT?
<depends optional="true">com.jetbrains.php.dql</depends> | |
<depends>com.jetbrains.php.dql</depends> |
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.
IntelliJ is smart enough to handle unknown languages (i.e. DQL plugin is not installed), when calling registrar.startInjecting(language)
. So there is no need to check that explicitly.
I'm not sure if it is a good idea to have this dependency mandatory. I think there are a lot people out there who only use some Symfony components and thus have the Symfony plugin installed, but don't need/use Doctrine/DQL.
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 far as I can see, "DQL Support" is bundled by default in PhpStorm. So this affects only people with IntelliJ IDEA Ultimate who have installed PHP plugin manually.
This adds automatic language injection for method parameters for the following languages:
CssSelector
andDomCrawler
componentJsonResponse
createQuery
and$dql =
assignments) (JetBrains added official DQL Support since PhpStorm 2018.3, but you had to inject manually or use<<<DQL
heredoc)Advantages:
CSS Selectors:


and
XPath:

DQL:

I also wrote tests for these injections.
One question for me remains:
Should we add checkboxes to disable these languages injections (by each language) in settings dialog?