1
1
package fr .adrienbrault .idea .symfony2plugin .stubs ;
2
2
3
+ import com .intellij .openapi .extensions .ExtensionPointName ;
3
4
import com .intellij .openapi .project .Project ;
4
5
import com .intellij .openapi .util .Key ;
5
6
import com .intellij .psi .search .GlobalSearchScope ;
11
12
import fr .adrienbrault .idea .symfony2plugin .dic .XmlServiceParser ;
12
13
import fr .adrienbrault .idea .symfony2plugin .dic .container .ServiceInterface ;
13
14
import fr .adrienbrault .idea .symfony2plugin .dic .container .dict .ContainerBuilderCall ;
14
- import fr .adrienbrault .idea .symfony2plugin .dic .webDeployment .ServiceContainerRemoteFileStorage ;
15
- import fr .adrienbrault .idea .symfony2plugin .routing .webDeployment .RoutingRemoteFileStorage ;
15
+ import fr .adrienbrault .idea .symfony2plugin .extension .ServiceCollectorParameter ;
16
16
import fr .adrienbrault .idea .symfony2plugin .stubs .cache .FileIndexCaches ;
17
17
import fr .adrienbrault .idea .symfony2plugin .stubs .indexes .ContainerBuilderStubIndex ;
18
18
import fr .adrienbrault .idea .symfony2plugin .stubs .indexes .ContainerParameterStubIndex ;
19
19
import fr .adrienbrault .idea .symfony2plugin .stubs .indexes .ServicesDefinitionStubIndex ;
20
20
import fr .adrienbrault .idea .symfony2plugin .util .service .ServiceXmlParserFactory ;
21
- import fr .adrienbrault .idea .symfony2plugin .webDeployment .utils .RemoteWebServerUtil ;
22
21
import org .apache .commons .lang .StringUtils ;
23
22
import org .jetbrains .annotations .NotNull ;
24
23
import org .jetbrains .annotations .Nullable ;
@@ -33,6 +32,10 @@ public class ContainerCollectionResolver {
33
32
private static final Key <CachedValue <Set <String >>> SERVICE_CONTAINER_INDEX_NAMES = new Key <CachedValue <Set <String >>>("SYMFONY_SERVICE_CONTAINER_INDEX_NAMES" );
34
33
private static final Key <CachedValue <Set <String >>> SERVICE_PARAMETER_INDEX_NAMES = new Key <CachedValue <Set <String >>>("SERVICE_PARAMETER_INDEX_NAMES" );
35
34
35
+ private static final ExtensionPointName <fr .adrienbrault .idea .symfony2plugin .extension .ServiceCollector > EXTENSIONS = new ExtensionPointName <>(
36
+ "fr.adrienbrault.idea.symfony2plugin.extension.ServiceCollector"
37
+ );
38
+
36
39
public static enum Source {
37
40
INDEX , COMPILER
38
41
}
@@ -199,6 +202,16 @@ public Map<String, ContainerService> getServices() {
199
202
200
203
Collection <ServiceInterface > aliases = new ArrayList <ServiceInterface >();
201
204
205
+ // Extension points
206
+ ServiceCollectorParameter .Service parameter = null ;
207
+ for (fr .adrienbrault .idea .symfony2plugin .extension .ServiceCollector collectorEx : EXTENSIONS .getExtensions ()) {
208
+ if (parameter == null ) {
209
+ parameter = new ServiceCollectorParameter .Service (project , aliases );
210
+ }
211
+
212
+ collectorEx .collectServices (parameter );
213
+ }
214
+
202
215
for (Map .Entry <String , List <ServiceInterface >> entry : FileIndexCaches .getSetDataCache (project , SERVICE_CONTAINER_INDEX , SERVICE_CONTAINER_INDEX_NAMES , ServicesDefinitionStubIndex .KEY , ServiceIndexUtil .getRestrictedFileTypesScope (project )).entrySet ()) {
203
216
204
217
// dont work twice on service;
@@ -298,6 +311,16 @@ private Set<String> getNames() {
298
311
299
312
if (this .sources .contains (Source .INDEX )) {
300
313
314
+ // Extension points
315
+ ServiceCollectorParameter .Id parameter = null ;
316
+ for (fr .adrienbrault .idea .symfony2plugin .extension .ServiceCollector collectorEx : EXTENSIONS .getExtensions ()) {
317
+ if (parameter == null ) {
318
+ parameter = new ServiceCollectorParameter .Id (project , serviceNames );
319
+ }
320
+
321
+ collectorEx .collectIds (parameter );
322
+ }
323
+
301
324
serviceNames .addAll (
302
325
FileIndexCaches .getIndexKeysCache (project , SERVICE_CONTAINER_INDEX_NAMES , ServicesDefinitionStubIndex .KEY )
303
326
);
0 commit comments