[php] autocomplete is not showing user variables
I don't really understand how it's working. VSCode does not suggest me any of my variables. Only globals as $_COOKIE and etc. I was trying to type few letters of my variable name and press Ctrl+Space, and it's says "No suggestions".
@h2u are you using a php extension for VS Code?
No, i don't use any php extensions.
Seems I'm only getting autocomplete suggestions when I start typing a variable name without the leading $.
If i have variable like: $string = 'my string'; and on next line i start writing "$st" or "st" - there is no any suggestions like $string variable.

Huh. Debugged a little more, seems I need to not have a leading $ AND press the up arrow on my keyboard to get it to sometimes show up as a possible selection. Either way, definitely bugged.
Edit: More information using the variable "$apple"
- Start typing 'ap', see results highlighting 'a', 'p', and 'ap' in functions like array_pop() and array_map().
a. If I press esc and then ctrl+space here, I get 'no suggestions'. - Type another 'p', all suggestions go away.
- Press backspace, suggestions from 1 show up, but without blue letters.
- Backspace again, get suggestions with just the 'a' highlighted in blue.
- Backspace again, empty line, suggestion window closes.
- Press ctrl+space, I can see $apple just after the super-globals.
- Type an 'a', and use the up arrow to find $apple.
- Typing more letters will correctly filter to $apple.
So basically, I guess you need to trigger the completion provider before typing anything to get variables to show up...
Thank you, @mattacosta for information. But how can i trigger the completion provider? :)
Afaik the whole PHP Intellisense is only based of a list of global functions and superglobals. I already thought about writing a PHP extension for better Intellisense, that actually constructs an AST of the code and looks at the variables in the current scope etc., suggests methods for classes following PSR autoloading, but I don't have the time for it.
The same happens to me. VS Code 0.10.11 on OSX El Capitan.