-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code hints in foreach #5
Comments
@TomMalbran it was actually worse than your test case. Basically any time you did a 2nd replacement on the same line with another word that started the same way, it would get rid of the rest of the line and insert the first occurrence again. I switched to using Can you give it a quick test with the issue-5 branch to confirm it works with your test case? |
I thought it might be a bigger issue that just in the foreach, but I didn't tested with anything else. Using |
I guess you could also use |
I've been using this extension and saw this bug. I was writing something like:
foreach ($fields as $f|
, where | is the cursor. I then got some hints at$f
and I chose$field
. But then it replaced$fields
, so I gotforeach ($field|
instead offoreach ($fields as $field|
.After some testing I saw that this bug only happens when the variable for the array starts with the same letters as the variable for the value. If I have
foreach ($array as $v|
the codehints do not replace$array
when I select something like$value
for the second variable. If I haveforeach ($fields as $fo|
the codehints do not replace$fields
when I select something like$foo
for the second variable.The text was updated successfully, but these errors were encountered: