File tree Expand file tree Collapse file tree 2 files changed +15
-16
lines changed Expand file tree Collapse file tree 2 files changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -17,19 +17,10 @@ public function __construct(ClassNameCompleter $completer)
17
17
}
18
18
public function getEntries (Project $ project , Context $ context )
19
19
{
20
- list ($ type , $ isThis , $ types ) = $ context ->getData ();
21
- if (is_array ($ types )) {
22
- $ fqcn = array_pop ($ types );
23
- if ($ fqcn instanceof FQCN
24
- && $ fqcn ->toString () === 'DI \\Container '
25
- ) {
26
- return array_map (
27
- [$ this , 'wrapEntry ' ],
28
- $ this ->classNameCompleter ->getEntries ($ project , $ context )
29
- );
30
- }
31
- }
32
- return [];
20
+ return array_map (
21
+ [$ this , 'wrapEntry ' ],
22
+ $ this ->classNameCompleter ->getEntries ($ project , $ context )
23
+ );
33
24
}
34
25
35
26
public function wrapEntry ($ entry )
Original file line number Diff line number Diff line change 4
4
5
5
use Symfony \Component \EventDispatcher \EventDispatcher ;
6
6
use Complete \Resolver \NodeTypeResolver ;
7
- use Complete \Completer \ CompleterFactory ;
7
+ use Complete \CompleteEngine ;
8
8
use Parser \UseParser ;
9
+ use Entity \FQCN ;
9
10
10
11
class Plugin
11
12
{
@@ -30,7 +31,7 @@ public function init()
30
31
[$ this ->resolver , 'handleTypeResolveEvent ' ]
31
32
);
32
33
$ this ->dispatcher ->addListener (
33
- CompleterFactory ::CUSTOM_COMPLETER ,
34
+ CompleteEngine ::CUSTOM_COMPLETER ,
34
35
[$ this , 'handleCompleteEvent ' ]
35
36
);
36
37
}
@@ -39,7 +40,14 @@ public function handleCompleteEvent($e)
39
40
{
40
41
$ context = $ e ->context ;
41
42
if ($ context ->isMethodCall ()) {
42
- $ e ->completer = $ this ->completer ;
43
+ list ($ type , $ isThis , $ types , $ workingNode ) = $ context ->getData ();
44
+ $ fqcn = array_pop ($ types );
45
+ if ($ fqcn instanceof FQCN
46
+ && $ fqcn ->toString () === 'DI \\Container '
47
+ && $ workingNode ->name === 'get '
48
+ ) {
49
+ $ e ->completer = $ this ->completer ;
50
+ }
43
51
}
44
52
}
45
53
You can’t perform that action at this time.
0 commit comments