Skip to content

Conversation

@felixfbecker
Copy link
Owner

Fixes #566

@codecov
Copy link

codecov bot commented Dec 28, 2017

Codecov Report

Merging #568 into master will increase coverage by 0.05%.
The diff coverage is 94.44%.

@@             Coverage Diff              @@
##             master     #568      +/-   ##
============================================
+ Coverage     81.52%   81.57%   +0.05%     
- Complexity      901      906       +5     
============================================
  Files            61       61              
  Lines          2062     2068       +6     
============================================
+ Hits           1681     1687       +6     
  Misses          381      381
Impacted Files Coverage Δ Complexity Δ
src/DefinitionResolver.php 87.17% <94.44%> (+0.13%) 326 <11> (+5) ⬆️

@phil-nelson
Copy link
Contributor

Thanks, this is a better solution that mine, I was struggling to work out how to do something like this as your suggestion.

@felixfbecker
Copy link
Owner Author

This also includes a change unrelated to the bug, in that before we only checked previous siblings and parents, but not the descendants of those. So this wouldn't register $foo before:

if (true) {
  $foo = 123
}
$f| // no completion for $foo

now it should.

With that change I could make it so that the search for the foreach key/value starts at the parent/sibling too because it can then traverse into the ForeachStatement, but not if that was the starting point.

@felixfbecker
Copy link
Owner Author

@jens1o @phil-nelson if anyone wants to test: php-intellisense-1.5.4.vsix.zip

@felixfbecker felixfbecker force-pushed the find-variables-in-sibling-children branch from 578b9f5 to e662519 Compare December 28, 2017 23:34
@phil-nelson
Copy link
Contributor

I've had a play with this branch, no problems so far 👍

@jens1o
Copy link
Contributor

jens1o commented Dec 30, 2017

Works like a charm :)

@felixfbecker felixfbecker merged commit 20960a8 into master Dec 31, 2017
@felixfbecker felixfbecker deleted the find-variables-in-sibling-children branch December 31, 2017 06:26
RenovZ pushed a commit to RenovZ/php-language-server that referenced this pull request Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants