Raffael
Raffael

Reputation: 20045

Why does PhpStorm not suggest a variable name in a string?

Given the fantastic coding guidance PhpStorm offers I am a bit confused regarding the lack of variable name suggestions for variables used in strings.

$variable = "something";

// A:
$variable;

// B:
$str = "$variable";

// C:
$str = "{$variable}";

In case A PhpStorm suggests variables, not in cases B and C though.

As this is a very straightforward feature and Eclipse offers it too, I guess I have to adjust my configuration.

Any ideas?

Upvotes: 4

Views: 592

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 401915

Works fine in both cases (verified in 2.1.4), however automatic completion is not enabled in order not to distract you from the actual string editing and you have to press Ctrl+Space to invoke code completion:

code completion on ctrl+space

Upvotes: 6

Related Questions