Skip to content
Permalink
Browse files

Allow completion from functions to work without namespacing cc @iluuu…

  • Loading branch information...
muglug committed Jul 19, 2019
1 parent 3df248e commit 0e6bd79a09b3d6845d138c2094b3964e321aaec8
@@ -237,17 +237,6 @@ public static function analyze(
strtolower($function_id)
);
if (!$context->collect_initializations
&& !$context->collect_mutations
) {
ArgumentMapPopulator::recordArgumentPositions(
$statements_analyzer,
$stmt,
$codebase,
$function_id
);
}
if (!$namespaced_function_exists
&& !$stmt->name instanceof PhpParser\Node\Name\FullyQualified
) {
@@ -266,6 +255,18 @@ public static function analyze(
$function_exists = true;
}
if ($function_exists
&& !$context->collect_initializations
&& !$context->collect_mutations
) {
ArgumentMapPopulator::recordArgumentPositions(
$statements_analyzer,
$stmt,
$codebase,
$function_id
);
}
$is_predefined = true;
$is_maybe_root_function = !$stmt->name instanceof PhpParser\Node\Name\FullyQualified
@@ -329,6 +329,7 @@ public function providerGetSignatureHelp(): array
[new Position(10, 40), 'B\A::staticfoo', 0],
[new Position(12, 28), 'B\foo', 0],
[new Position(14, 30), 'B\A::__construct', 0],
[new Position(16, 31), 'strlen', 0],
];
}
@@ -362,9 +363,7 @@ public function foo(string $a, array $b) {
new A();
// Blocked by https://github.com/nikic/PHP-Parser/issues/616
//$this->foo(, "Bar");
//$this->foo(,,);
strlen();
}
public function bar(string $a) {}

2 comments on commit 0e6bd79

@iluuu1994

This comment has been minimized.

Copy link
Contributor

replied Jul 19, 2019

Hi @muglug! I'm confused on why this was necessary. This was already working as far as I know.

@iluuu1994

This comment has been minimized.

Copy link
Contributor

replied Jul 19, 2019

Oh sorry, I missed the part where you changed the if condition.

Please sign in to comment.
You can’t perform that action at this time.