PHPStorm/Webstorm setting to adjust # of “peek” lines at top of control statement

StackOverflow https://stackoverflow.com/questions/5355250

  •  27-10-2019
  •  | 
  •  

Question

In PHPStorm, WebStorm, and MPS, is there a setting or way to get the "peek" functionality to show two lines on a control statement (that is, IF or FOR or WHILE) when using Allman/BSD style coding (braces on a separate line)?

When the cursor is behind the closing brace, the "peek" functionality works (showing the opening brace), but it only shows one line, the actual line of the opening brace, which is almost worthless. Note this functionality works perfectly with a CLASS, showing two lines, but not with a CONTROL statement or METHOD.

See screenshots below of (1) an IF statement and (2) a CLASS definition.

I have my code style appropriately specified under settings/code style, but this doesn't seem to be helping. This problem is very annoying!

Peeking at IF statement Peeking at class definition



UPDATE: This works GREAT with JavaScript files... Why can't we get the same behavior with PHP files?

Example of this is working great with a JavaScript file:

Enter image description here

Was it helpful?

Solution

This functionality was not implemented for PHP (it has to be implemented for each file type/language separately). It was fixed and is available in PhpStorm 2.1.1 or newer.

Corresponding ticket: http://youtrack.jetbrains.net/issue/WI-3667?projectKey=WI

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top