Skip to content

Commit 2c4f0fc

Browse files
committed
added fixes for vim client
1 parent 1cc6b9c commit 2c4f0fc

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
distribute, sublicense, and/or sell copies of the Software, and to
66
permit persons to whom the Software is furnished to do so, subject to
77
the following conditions:
8-
8+
99
The above copyright notice and this permission notice shall be included
1010
in all copies or substantial portions of the Software.
11-
11+
1212
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1313
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1414
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

src/Command/SaveCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Command;
44

55
class SaveCommand extends AbstractCommand {
6-
public function run(array $arguments){
6+
public function run(array $arguments = []){
77
$project = $arguments["project"];
88
/** @var \IO\Writer $writer */
99
$writer = $this->get('IO\Writer');

src/DI/config.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
Psr\Log\LoggerInterface::class => DI\factory(function () {
77
$logger = new Logger('completer');
88

9-
$logger->pushHandler(new \Monolog\Handler\ErrorLogHandler());
9+
$logger->pushHandler(new \Monolog\Handler\StreamHandler(
10+
"php://stdout"
11+
));
1012
return $logger;
1113
}),
1214
];

src/Parser/Processor/ScopeProcessor.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
use Parser\UseParser;
66
use Parser\CommentParser;
7-
use Complete\Resolver\NodeTypeResolver;
87
use Parser\ParamParser;
8+
use Parser\NamespaceParser;
9+
use Complete\Resolver\NodeTypeResolver;
910

1011
use Entity\FQCN;
1112
use Entity\Index;
@@ -21,6 +22,7 @@
2122
use PhpParser\Node\Expr\Assign;
2223
use PhpParser\Node\Stmt\Use_;
2324
use PhpParser\Node\Stmt\Class_;
25+
use PhpParser\Node\Stmt\Namespace_;
2426
use PhpParser\Node\Stmt\ClassMethod;
2527
use PhpParser\Node\Expr\Closure;
2628

@@ -29,13 +31,15 @@ public function __construct(
2931
UseParser $useParser,
3032
NodeTypeResolver $typeResolver,
3133
CommentParser $commentParser,
32-
ParamParser $paramParser
34+
ParamParser $paramParser,
35+
NamespaceParser $namespaceParser
3336
){
3437
$this->resultNodes = [];
3538
$this->useParser = $useParser;
3639
$this->typeResolver = $typeResolver;
3740
$this->commentParser = $commentParser;
3841
$this->paramParser = $paramParser;
42+
$this->namespaceParser = $namespaceParser;
3943
}
4044
public function setLine($line){
4145
$this->line = $line;
@@ -48,6 +52,9 @@ public function enterNode(Node $node){
4852
if($node instanceof Class_){
4953
$this->createScopeFromClass($node);
5054
}
55+
elseif($node instanceof Namespace_){
56+
$this->namespaceParser->parse($node);
57+
}
5158
elseif($node instanceof ClassMethod){
5259
$this->createScopeFromMethod($node);
5360
}
@@ -197,4 +204,5 @@ protected function createScope(){
197204
private $commentParser;
198205
/** @property ParamParser */
199206
private $paramParser;
207+
private $namespaceParser;
200208
}

0 commit comments

Comments
 (0)