Completion inside strings

I'm new to phpstorm so I don't know if this is something I'm just missing or it is not implemented yet.
My problem is I'm used to realy silly completion from vim (via unconfigured Ctrl-P) which just complete from words in all open buffers, ignoring context.
It is very handy if You are working with "string oriented" framework like CakePHP where You type a lot of code like:

$dealer_name = $original['Dealer']['name'];
$id = (int) $this->data['Dealer']['id'];
$this->data ['DomainProgram']['id'] = $programId;

So You tend to write a lot of string indexes. And they tend to get longer on larger projects. Is there any way to autocomplete these (i.e. ['Dealer'], ['DomainProgram']) in PhpStorm?
Thanks for any info on this subject,
Petr Sykora


The action I was looking for is called Cyclic Expand Word (Alt + /) & Cyclic Expand Word (Backward) (Alt + Shift + /) in PhpStorm. I'm writing it here in case someone else has the same migration problem.


I've been looking to get completion (or hinting) to work inside any string. Even a simple SQL statement it wont. Take for example: "select * from ticket with ticket_number = $ticketNumber".

Sinple enough. But the var "$ticketNumber" never hits (or any var inside a string). If I press ctrl+space I get nothing. Though hinting does work with the table field names and SQL keywords. Oddly, Netbeans can do this.

Maybe I got something setup wrong?


Hi Stephen,

That's different thing (to the original subject). Currently PhpStorm does not support completion of PHP variables inside Injected Language fragments.


WAHHH! But thanks. I voted for fixing this bug.


I voted for it too. Autocompletion inside strings is quite important in my opinion.


Please sign in to leave a comment.