phptools-docs icon indicating copy to clipboard operation
phptools-docs copied to clipboard

Autocomplete in string keeps suggesting variable that no longer exists after editing code

Open php4fan opened this issue 4 months ago • 1 comments

I started with this code:

<?php

$pimpumpapam = 123;

and I wanted to use the variable in a string, so I started typing:

Image

and as you can see I get the suggestion as expected.

Then I edited the code and changed the name of the variable, then I deleted the variable from within the string and started re-typing it:

Image

As you can see, it keeps suggesting the variable that no longer exist, and it does not suggest the variable name that now does exist.

In this example while taking screenshots I forgot to put something like an echo before the string to make the code make sense, but that's irrelevant, I have observed the issue with sensible code.

It seems that the autocomplete suggestions for stuff inside the string don't update when the code outside the string changes, unless you delete and rewrite the entire string.

This is not quite the same as https://github.com/DEVSENSE/phptools-docs/issues/892#issuecomment-3109352316 but I guess it might be related.

php4fan avatar Jul 25 '25 17:07 php4fan