I have to admit, for a FREE PRODUCT, Eclipse really delivers. However, sometimes I don't understand certain missing features...
Eclipse has over ELEVEN HUNDRED different key bindings.
(source: rigel222.com)
I would like to use one of those KeyBindings to add a "Watch" Expression to the expressions window, while debugging.
(source: rigel222.com)
Here is an additional screenshot showing that I already understand the "filter" process. I have set key-bindings for everything I could find pertaining to "Watch", but as you can see it doesn't show up in my right-click menu, and does not function when I use the defined keyboard shortcut.
(source: rigel222.com)
Despite the prevailing opinion that this is "blatant whining", It is also a legitimate problem for me.
Please help.
The menu item you seek is filtered out by default from the view. There is a filter button near the lower right corner of the window. There you should uncheck the "Filter uncategorized commands" checkbox, and then searching for watch should produce Add to Watch, Add Watch Expression output. I'm not entirely sure these are the ones you need, but it might work.
Related
Let's say I want to type the following in PhpStorm:
$longObjectName->propertyName = 'some value';
Seems innocent enough, no? If I start typing longOb, code completion kicks in and helpfully provides $longObjectName as a suggestion, since it exists elsewhere in my project. I think to myself, "Ah perfect, that's exactly what I wanted", so I hit Enter or Tab to accept the suggestion. At this point, I'm feeling pretty happy.
But now I want to insert ->, PHP's awkward but familiar object operator. If I type it manually, that's three whole keystrokes (including Shift), which makes me feel just a bit sad. A distant, nagging doubt begins to enter my mind. "Three keystrokes? What kind of evil IDE is this? Who are these ruthless dictators at JetBrains??"
The emotional roller coaster continues when I see the following in PhpStorm's Tip of the Day dialog, bringing a minuscule but insistent glimmer of hope to my dark, Monokai-schemed world:
When using Code Completion, you can accept the currently highlighted
selection in the popup list with the period character (.), comma (,),
semicolon (;), space and other characters.
The selected name is
automatically entered in the editor followed by the entered character.
In JavaScript, this means I can type longOb and hit . to both accept the first code completion suggestion and insert the JS object operator, resulting in longObjectName., at which point I can keep typing a property name and go on autocompleting all day long without ever hitting Enter. Amazing. Revolutionary even.
Now for some devastating news: it doesn't seem to work in PHP. (Fret not children—this harrowing tale is almost at its end.)
If I type longOb and then hit -, I get this:
longOb- // :(
I'm pretty sure the PHP interpreter wouldn't like me very much if I tried to execute that.
(Side note: ., ,, and ; exhibit pretty much the same behavior, contrary to the quoted Tip of the Day above.)
So here's what I would get if I were to make my fantasy world a reality:
$longObjectName->[handy dandy code completion list, primed and ready for action]
Wouldn't that be flipping awesome?
So finally, we arrive at the ultimate question, with some redundant stuff added for those who didn't bother to read my action-packed, heartwrenching story:
Is there a single keyboard shortcut in PhpStorm for "Accept the currently highlighted code completion suggestion and insert the PHP object operator (->)"?
Or is this just a bug?
Well, I solved this problem by recording a Macro and then binding it with a keyboard shortcut:
Go to Edit | Macros | Start Macro Recording
Type '->'
Stop Macro Recording using the button in the lower right corner, then name it whatever you want.
Assign Shortcut to it:
Go to File | Settings | Keymap | Macros |
Right click and choose 'Add Keyboard Shortcut'
I chose Ctrl+. as the shortcut and now I am more than happy. :)
You can use autohotkey (http://www.autohotkey.com/) to create new keystrokes and replace PHP Object Operator for period or anything else.
For example, with a script like this:
^.::
Send ->
return
Will replace (ctrl + .) with (->), in anywhere in Windows.
Or
#IfWinActive ahk_class SunAwtFrame
.::
Send ->
return
Will replace . (period) with (->) only in PhpStorm Window (Or others with ahk_class SunAwtFrame).
Use Window Spy to see the ahk_class class of any Windows Window.
You can use CTRL + . as . (period)
#IfWinActive ahk_class SunAwtFrame
^.::
Send .
return
1) As far as I remember this kind of completion was asked to be removed for PHP code (too unusual) .. but I cannot find such ticket right now (already spend over 20 mins on this) .. so I could be wrong (it was quite some time ago .. so possibly I'm confused with another code-completion improvement which was hard-configured to behave differently for PHP code only).
Kind of related to "why it was disabled/what problems where there in the past":
http://youtrack.jetbrains.com/issue/WI-7013
http://youtrack.jetbrains.com/issue/IDEA-88179
http://youtrack.jetbrains.com/issue/IDEA-59718
In any case: there is an open ticket to actually having it working: http://youtrack.jetbrains.com/issue/WI-21481 (only 1 vote so far).
2) There is no "complete with ->" action available. Related ticket: http://youtrack.jetbrains.com/issue/WI-17658 (star/vote/comment to get notified on progress)
I wanted ST3 to include the "$" when selecting PHP files so I edited word_separators by removing $ as such :
"word_separators": "./\\()\"':,.;<>~!##%^&*|+=[]{}`~?"
And now it highlight the whole varibale including the "$" when double clicking a variable. However, now Sublime is not matching/outlining those variables using the default match_selection functionality.
Any thoughts on this? Is there a setting I am missing. Much appreciated.
Please see my answer to this question for an in-depth look at the effect of changing word_separators and various find and select options. Long story short, altering word_separators changes the behavior of double-clicking, as you noted, but other operations, including match_selection, rely on an internal word separators list that apparently can't be altered by the user. So, when you double-click to select a PHP variable, you'll get the $ selected, but other instances of the variable won't be highlighted. They will be selected when using CtrlD to make multiple selections, however:
Additionally, when using the Find dialog, other instances will be highlighted:
So, to address your original problem, if you need to see all the instances of the currently-selected variable, set "find_selected_text": true in your user preferences, double-click to select your variable of interest, then hit CtrlF (⌘F on OS X) to view all occurrences. Just make sure you don't have the regex search button selected, as $ has a special meaning in regexes.
I want to embed in a page a detailed structure report of my model objects, like print_r() or var_export() produce (now I’m doing this with running var_export() on get_object_vars()). But what I actually want to see is only some properties (in most cases), but at this moment I have to use Ctrl+F and seek the variable I want, instead of just staring at it right after the page completes loading. So I’m embedding buttons to show/hide large arrays etc. but thought: ‘What if there already is the thing I do right now?’ So is there?
Update:
What would your ideal interface look like?
First of all, dumped models fit in the first screen. All the properties can be seen at the first look at the screen (there are not many of them, around 10 per each, three models total, so it is possible). Small arrays can be shown unrolled too. Let the size of the array to count it as ‘small’ be definable. Ideally, the user can see values of the properties without doing any click, scrolling the screen or typing something.
There must be some improvements to representing the values, say, if an array is empty, show
array ‘My_big_array’ is empty
and if a boolean variable starting with is_, has_, had_ has a false as the value, make the variable (let us take is_available for example) shown as
is_NOT_available
in red, and if it has true as the value, show
is_available
in green. Without any value shown. The same goes for defined constants.
That would be ideal.
I want to make focus on this kind of switches.
Krumo seems useful, but since it always closes up the variable without making difference of how large it is, I cannot use it as is, but there might appear something similar on github soon :)
Second update starts here:
Any programmer who sees is_available = false will know what it means, no need to do more
Bringing in color indication I forgot about one thing: the ‘switches’ let’s call them so, may me important or not. So I have right now some of them that will show in green or red, this is for something global, like caching, which is shown as
Caching is… ON
with ‘ON’ written in green, (and ‘OFF’ in red when disabled) while the words about what it is, i.e. ‘Caching is… ’ are written in black.
And some which are not so important, for example I haven’t defined
REVEAL_TIES is… not set
with ‘not set’ written in gray, while the words describing what it is stay in black. And if it would be set the whole phrase would be in black since there is nothing important: if this small utility for showing some undercover things is working, I will see some messages after it, if it isn’t — site will be working independently of its state.
Dividing switches into important ones and not with corresponding color match should improve readability, especially for those users who are not programmers and just enabled debug mode because some guy from bugzilla said do that — for them it would help to understand what is important and what is not.
A big thanks to all who replied.
I am a noob to Komodo and I'm trying to figure out how to use it to my best advantage. One thing keeps bugging me & there's probably a very simple answer.
As an example, when I type
if(isset($_GET['
Komodo will automatically fill in the rest of that line: '])) which is great. Except that my cursor remains before that autocompleted part, so I have to move my hand to the arrows and manually navigate to the next line or the end of that line or whatever.
It seems like there should be a key combination to jump past the autocompleted brackets/parentheses/quotes so I can just continue on typing without moving over to the arrow keys.
But I don't know what that is! Do you?
Use the combination of holding down the Ctrl key (Alt on OSX) while pressing the right arrow to jump to the end of the current statement.
Caret stays there because Komodo understands you need to populate the string. Just hit End when done.
I'm not sure if I'm missing something as I'm new to Aptana but. I'm having trouble collapsing my class methods. I like to collapse everything except the function I'm currently working in within my class but everytime collapse and then go to edit, everything expands again.
I'm guessing it's therefore some sort of feature that everything within a class is expanded when editing any method within the class. Is there any way around this at all. I'm loving Aptana so far, but this is extremely annoying.
For Mac, it's Shift-Command-/ using the / on the numpad
It doesn't work with the / next to the shift key.
I suspect this will work on PC, too.
Like you this one has bugged me on and off for quite a while and it's even more annoying when I found out how stupidly simple the answer is. It's not written in any of the documentation that I can find.
But all you have to do is fold up all the methods, functions, classes etc that you want folded, then hit "ctrl s" to save. That's it. This step is not required in some other editors so it didn't occur to me immediately.
Thereafter if you hover over the + icon you get a preview of the folded up code.
Obviously if you click on + the code expands.
By the way: if you want to add to the items that can be folded:
select window -> preferences
either type "folding" in the type filter text box
or
select general -> PyDev -> Code Folding
check the appropriate items -> apply -> ok