phptools-docs
phptools-docs copied to clipboard
variables are not suggested inside string
To reproduce:
- In a PHP file, write this:
<?php
$myvariable = "lorem ipsum";
$string = "Foo bar $myv"; // <<<< I'm still typing, my cursor is after the 'v'
Expected behavior
As you type, it should suggest autocompleting the variable name to $myvariable
, just like it does when you are outside of a string.
Observed behavior
Doesn't suggest anything. It seems to be unaware of variable expansion in double-quoted strings in PHP.
will be implemented, thank you!
Currently, in VS Code the code completion popups only when there is at least one letter, and completion is popuped explicitly with a shortcut:
It seems VSCode does not let us to trigger completion automatcally upon typing $
in a string.
Now it's suggesting variables even inside single-quoted strings:
and even though I didn't type a $
in the first place!!!
If I accept the suggestion it adds the $ (that is consistent with giving the suggestion in the first place, but the suggestion makes no sense):
Now it's suggesting variables even inside single-quoted strings:
That seems to be happening only inside of ['']
, which makes me wonder if it's more related to https://github.com/DEVSENSE/phptools-docs/issues/470
Thank you for reporting that.
You're right, it seems we popup completion of everything inside ['']
Completion of variables inside double-quoted strings implemented -> closing.
The bug with ['']
will be closed at https://github.com/DEVSENSE/phptools-docs/issues/470
Thanks!
Still fails randomly half of the time
I see, let me check what's changed.
@php4fan fixed it for the next update, thanks!