Skip to content

Commit ac9a339

Browse files
committed
Merge branch 'master' into feature/phpstorm-8
Conflicts: META-INF/plugin.xml
2 parents bac43ab + c553465 commit ac9a339

36 files changed

+884
-288
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ Changelog
66
0.10.x: PhpStorm 7 (support until PhpStorm8 release)
77
0.9.x: PhpStorm 6 (no support)
88

9+
### 0.10.76 / 0.11.76
10+
* Implement docblock "@var" for twig variables, shortcut without tag is deprecated
11+
* Optimize xlf navigation and references; better getDomainFilePsiElements translation performance
12+
* Provide a global class::method[Action] yaml navigation, usable inside Drupal
13+
* Translation extractor supports text selection
14+
* Provide shortcut completion with function insertHandler for twig tags: href, src (css/js)
15+
* Improve overall support for routes; better xml parser, more data and nicer completion #369
16+
* Fix possible npe in PhpEventDispatcherGotoCompletionRegistrar
17+
* Fix service completion in single quote yaml string values to reflect PhpStorm lexer changes; eg Drupal code convention
18+
* Fix regular expression for trans and transchoice to support more cases #377; also fix some whitespace issues
19+
* Fix npe in NewControllerAction on non bundle context #378
20+
921
### 0.10.75 / 0.11.75
1022
* Add twig constants navigation, completion and folding #327
1123
* Add references for array methods inside EventSubscriberInterface returns

META-INF/plugin.xml

Lines changed: 17 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin version="2" url="https://github.com/Haehnchen/idea-php-symfony2-plugin">
22
<id>fr.adrienbrault.idea.symfony2plugin</id>
33
<name>Symfony2 Plugin</name>
4-
<version>0.11.75</version>
4+
<version>0.11.76</version>
55
<vendor email="daniel@espendiller.net" url="http://espend.de">Daniel Espendiller</vendor>
66

77
<description><![CDATA[
@@ -104,6 +104,20 @@
104104
105105
<br>
106106
107+
<h2>0.10.76 / 0.11.76</h2>
108+
<ul>
109+
<li>Implement docblock "@var" for twig variables, shortcut without tag is deprecated <a href="http://symfony2-plugin.espend.de/languages/twig/index.html#phptypes">Doc</a></li>
110+
<li>Optimize xlf navigation and references; better getDomainFilePsiElements translation performance</li>
111+
<li>Provide a global class::method[Action] yaml navigation, usable inside Drupal</li>
112+
<li>Translation extractor supports text selection</li>
113+
<li>Provide shortcut completion with function insertHandler for twig tags: href, src (css/js)</li>
114+
<li>Improve overall support for routes; better xml parser, more data and nicer completion <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/369">#369</a></li>
115+
<li>Fix possible npe in PhpEventDispatcherGotoCompletionRegistrar</li>
116+
<li>Fix service completion in single quote yaml string values to reflect PhpStorm lexer changes; eg Drupal code convention</li>
117+
<li>Fix regular expression for trans and transchoice to support more cases <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/377">#377</a>; also fix some whitespace issues</li>
118+
<li>Fix npe in NewControllerAction on non bundle context <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/378">#378</a></li>
119+
</ul>
120+
107121
<h2>0.10.75 / 0.11.75</h2>
108122
<ul>
109123
<li>Add twig constants navigation, completion and folding <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/327">#327</a></li>
@@ -270,99 +284,6 @@
270284
<li>Fix npe in config completion <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/284">#284</a></li>
271285
</ul>
272286
273-
<h2>0.10.57</h2>
274-
<ul>
275-
<li>Add yaml key completion for <a href="http://symfony2-plugin.espend.de/languages/yaml/index.html#config">config / security</a> files on "config:dump-reference"</li>
276-
<li>Add completion for QueryBuilder:set</li>
277-
<li>Make Twig translation key extractor compatible with PhpStorm8 and allow undo <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/213">#213</a></li>
278-
</ul>
279-
280-
<h2>0.10.56</h2>
281-
<ul>
282-
<li>Add twig <a href="http://symfony2-plugin.espend.de/actions/index.html#translation-extractor">translation extraction action</a> <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/213">#213</a></li>
283-
<li>Fix data_class in form types should autocomplete any class <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/280">#280</a></li>
284-
<li>Add completion for QueryBuilder:(*)where</li>
285-
</ul>
286-
287-
<h2>0.10.55</h2>
288-
<ul>
289-
<li>Finally(?) fix NullPointerException on index values <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/277">#277</a>, <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/238">#238</a></li>
290-
<li>Optimize Doctrine QueryBuilder chaining method collector to resolve methods and also fix some errors <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/278">#278</a>, <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/274">#274</a></li>
291-
<li>Reimplementation of Twig @Template goto on PHP Annotations extension <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/276">#276</a></li>
292-
<li>Migrate Route annotator to inspections <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/273">#273</a></li>
293-
<li>Typo fix to support Doctrine OneToOne relations</li>
294-
</ul>
295-
296-
<h2>0.10.54</h2>
297-
<ul>
298-
<li>Initial doctrine querybuilder support, see what is in <a href="http://symfony2-plugin.espend.de/extension/doctrine_querybuilder.html">doc</a></li>
299-
<li>Improvements in doctrine field property parser</li>
300-
<li>Activate twig filter and block name completion for upcoming PhpStorm8 (eap); resolved issues WI-19022, WI-20266</li>
301-
<li>Support entity in sub namespace, use indexer and improve performance</li>
302-
<li>Add repository references for QueryBuilder::update/delete/from <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/272">#272</a></li>
303-
<li>Fix goto for class names without namespace in yaml scalar key <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/271">#271</a></li>
304-
<li>Fix field name array completion for ObjectRepository::findBy</li>
305-
<li>Fix macro name set collector</li>
306-
<li>Form field completion should respect property names <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/259">#259</a></li>
307-
<li>Integrate PHP-Annotations plugins as optional dependency</li>
308-
<li>PHP Annotations: Allow alias for all @Template extension <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/236">#236</a></li>
309-
<li>PHP Annotations: Remove static list fully inside external plugin</li>
310-
<li>PHP Annotations: Route::service and some other references <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/245">#245</a></li>
311-
</ul>
312-
313-
<h2>0.10.53</h2>
314-
<ul>
315-
<li>Fix slow index on large files <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/261">#261</a></li>
316-
<li>Fix weak route annotation goto</li>
317-
</ul>
318-
319-
<h2>0.10.52</h2>
320-
<ul>
321-
<li>Globally use weak service and route index <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/261">#261</a></li>
322-
<li>Add new weak annotator for routes and services</li>
323-
<li>Add route name indexer for annotation </li>
324-
<li>Add custom index keys processor for filter them in project context</li>
325-
<li>Add extension point to load custom doctrine model classes</li>
326-
<li>Fix annotate blank string values</li>
327-
<li>Remove duplicate from type completion <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/260">#260</a></li>
328-
</ul>
329-
330-
<h2>0.10.51</h2>
331-
<ul>
332-
<li>Add twig macro name indexer</li>
333-
<li>Add macro include/from indexer and add implements linemarker</li>
334-
<li>Add custom "Symfony2 Symbol" search (Navigate > Symfony2 Symbol) in replacement for toolwindow <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/229">#229</a> (pls report possible keyboard shortcuts :) )</li>
335-
<li>Add twig macro and service index to symbol search</li>
336-
<li>Allow null keys in all index related stuff to temporary fix <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/238">#238</a></li>
337-
<li>Strip quoted values inside yaml container indexer</li>
338-
</ul>
339-
340-
<h2>0.10.50</h2>
341-
<ul>
342-
<li>Add twig include indexer</li>
343-
<li>Add twig linemarker for includes</li>
344-
</ul>
345-
346-
<h2>0.10.49</h2>
347-
<ul>
348-
<li>Add translation key and domain indexer</li>
349-
<li>Rewrite and refactoring of all translation related stuff</li>
350-
<li>Make translations available without a compiled file on indexer as weak references</li>
351-
<li>Improvements in multiline values and quote key files for translation keys</li>
352-
<li>Rename parameter indexer key name to force a refresh, pls report npe directly to <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/238">#238</a> with your environment data if still occur</li>
353-
</ul>
354-
355-
<h2>0.10.48</h2>
356-
<ul>
357-
<li>Improvements in repositoryClass detection of doctrine annotations eg namespaces</li>
358-
<li>Add typename for repository "find*" lookup elements</li>
359-
<li>Add support for annotations based models inside "find*" repository calls</li>
360-
<li>Add extension point for container file loading</li>
361-
<li>Add "Interface" and "ClassInterface" to type provider <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/254">#254</a></li>
362-
<li>Activate $option key references inside FormTypeInterface, because of working api now <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/162">#162</a></li>
363-
<li>Refactoring of container related linemarkers to fix some npe (api break?) <a href="https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/238">#238</a></li>
364-
</ul>
365-
366287
<br/>
367288
<a href="https://github.com/adrienbrault/idea-php-symfony2-plugin/blob/master/CHANGELOG.md">open full changelog</a>
368289
<br/>
@@ -443,6 +364,7 @@
443364

444365
<completion.contributor language="XML" implementationClass="fr.adrienbrault.idea.symfony2plugin.config.xml.XmlCompletionContributor"/>
445366
<completion.contributor language="Twig" implementationClass="fr.adrienbrault.idea.symfony2plugin.templating.TwigTemplateCompletionContributor"/>
367+
<completion.contributor language="HTML" implementationClass="fr.adrienbrault.idea.symfony2plugin.templating.completion.TwigHtmlCompletionContributor"/>
446368
<completion.contributor language="yaml" implementationClass="fr.adrienbrault.idea.symfony2plugin.config.yaml.YamlCompletionContributor"/>
447369

448370
<annotator language="PHP" implementationClass="fr.adrienbrault.idea.symfony2plugin.templating.PhpTemplateAnnotator"/>
@@ -453,7 +375,7 @@
453375
<annotator language="yaml" implementationClass="fr.adrienbrault.idea.symfony2plugin.config.yaml.YamlAnnotator"/>
454376
<annotator language="XML" implementationClass="fr.adrienbrault.idea.symfony2plugin.config.xml.XmlServiceContainerAnnotator"/>
455377

456-
<fileBasedIndex implementation="fr.adrienbrault.idea.symfony2plugin.stubs.indexes.YamlRoutesStubIndex"/>
378+
<fileBasedIndex implementation="fr.adrienbrault.idea.symfony2plugin.stubs.indexes.RoutesStubIndex"/>
457379
<fileBasedIndex implementation="fr.adrienbrault.idea.symfony2plugin.stubs.indexes.TwigExtendsStubIndex"/>
458380
<fileBasedIndex implementation="fr.adrienbrault.idea.symfony2plugin.stubs.indexes.ServicesDefinitionStubIndex"/>
459381
<fileBasedIndex implementation="fr.adrienbrault.idea.symfony2plugin.stubs.indexes.ContainerParameterStubIndex"/>

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import fr.adrienbrault.idea.symfony2plugin.routing.Route;
2020
import fr.adrienbrault.idea.symfony2plugin.routing.RouteHelper;
2121
import fr.adrienbrault.idea.symfony2plugin.util.IdeHelper;
22+
import fr.adrienbrault.idea.symfony2plugin.util.service.ServiceXmlParserFactory;
2223
import fr.adrienbrault.idea.symfony2plugin.widget.SymfonyProfilerWidget;
2324
import org.jetbrains.annotations.NotNull;
2425
import org.jetbrains.annotations.Nullable;
@@ -87,7 +88,7 @@ public void projectOpened() {
8788
}
8889

8990
public void projectClosed() {
90-
// System.out.println("projectClosed");
91+
ServiceXmlParserFactory.cleanInstance(project);
9192
}
9293

9394
public static Logger getLogger() {
@@ -103,6 +104,10 @@ public boolean isEnabled() {
103104
return Settings.getInstance(project).pluginEnabled;
104105
}
105106

107+
/**
108+
* Dont use is method anymore, RouteHelper provides several util methods in replacement
109+
*/
110+
@Deprecated
106111
public Map<String, Route> getRoutes() {
107112
Map<String, Route> routes = new HashMap<String, Route>();
108113

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,11 @@ public static ElementPattern<PsiElement> getTypeCompletionPattern() {
493493
.withLanguage(TwigLanguage.INSTANCE);
494494
}
495495

496-
public static PsiElementPattern.Capture<PsiComment> getTwigTypeDocBlock() {
497-
return PlatformPatterns
498-
.psiComment().withText(PlatformPatterns.string().matches(TwigTypeResolveUtil.DOC_PATTERN))
499-
.withLanguage(TwigLanguage.INSTANCE);
496+
public static ElementPattern<PsiComment> getTwigTypeDocBlock() {
497+
return PlatformPatterns.or(
498+
PlatformPatterns.psiComment().withText(PlatformPatterns.string().matches(TwigTypeResolveUtil.DOC_PATTERN)).withLanguage(TwigLanguage.INSTANCE),
499+
PlatformPatterns.psiComment().withText(PlatformPatterns.string().matches(TwigTypeResolveUtil.DOC_PATTERN_2)).withLanguage(TwigLanguage.INSTANCE)
500+
);
500501
}
501502

502503
public static PsiElementPattern.Capture<PsiComment> getTwigDocBlockMatchPattern(String pattern) {

src/fr/adrienbrault/idea/symfony2plugin/action/NewControllerAction.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,10 @@ public static void buildFile(AnActionEvent event, final Project project, String
104104

105105
if(symfonyBundle != null) {
106106
bundleName = StringUtils.strip(symfonyBundle.getNamespaceName(), "\\");
107-
}
108-
109-
String path = symfonyBundle.getRelative(initialBaseDir.getVirtualFile());
110-
if(path != null) {
111-
bundleName = bundleName.concat("\\" + path);
107+
String path = symfonyBundle.getRelative(initialBaseDir.getVirtualFile());
108+
if(path != null) {
109+
bundleName = bundleName.concat("\\" + path);
110+
}
112111
}
113112

114113
content = content.replace("{{ Namespace }}", bundleName).replace("{{ ControllerName }}", fileName);

0 commit comments

Comments
 (0)