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
Related
So, it's my first question here - i found a lot of hints which all working for itself but im struggling now with the final step to get solved.
Guess it's very specific pointed to TYPO3-CMS V9 and higher.
I can also support with all of the Codes, for the moment i guess this will be better on request.
Task: Create a simple Productorderform for logged-in-users pointing just there specific products form the specific price-lists. -> solved by using PHP-Script working with a CSV-File, grabbing also some functions from TYPO3 itself to get needed parameters.
This PHP creates a DATALIST on runtime for the INPUT-Field producing the needed HTML-Code -> solved and working as expected.
Tricky part.
As TYPO3 offers a CORE-Extension called FORM and the Option to - REPEAT - the fieldset.
Also for TYPO3 there is an extension which allows to put PHP-Code directly to TYPO3 as a Content-Element.
FORM itself allows to put Content-Element to a form.
Working so far, but as described, the field (its value) is not recognized when i fire the send button.
So for some reason i have to predefine the trigger also.
I tried step for step to extend the predefined field in the php with the tags of an empty one, all(?) the surrouding DIV etc. to make FORM recognize this field as a "native" field, just extend in the main tag with ... list="prodlist" ...
Well, as you might see, i'm not a developer or programmer, i might have some skills and experiences to know where and how to go with the level (and timeframe) i have.
So i guess the final step might not be that far, but as we say here, i can't see wood because of trees...
The FORM structure by the way is saved to a YAML-file which might be also manipulated, but as i have seen, it gets the triggers -what- to parse in some way from the FORM created.
Many thanks for hints, ideas an hopefully noone was falling to sleep reading this question... ;)
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 am using Sublime Text 3 as a PHP editor, I've been customizing the PHP.tmLanguage file to include more syntax scopes, right now I cannot figure out how to capture class method invocations.
$html = new HTML("hr");
$html->output_ml("moo");
output_ml is currently declared as scope variable.other.property.php
I would like to add a scope to pertain to specifically to class method calls, but I am having trouble defining the regex in the tmLanguage file.
I've tried
<dict>
<key>match</key>
<string>(?i)\$[a-z_][a-z0-9_]*->([a-z_][a-z_0-9]*)\s*\(</string>
<key>name</key>
<string>meta.method-call.php</string>
</dict>
You were pretty close, I just tweaked a few things:
(?i:(?!\$[a-z_][a-z0-9_]*->)([a-z_][a-z_0-9]*)\s*\()
First thing I did was wrap the entire expression in the "case-insensitive" modifier, just so nothing got missed. Probably not necessary, but whatever. Second, and more importantly, I took your first group that was outside of parentheses, and made them a negative lookahead. This way, they match the class name and the arrow, but don't report it - basically saying "match whatever is ahead of us as long as we exist in front of it, but don't match us."
Now, you'll have a scope that matches just the method's name.
Demo
Now, here's what I don't get - why you should have to do this. I maintain both a language syntax and a color scheme, so I have a lot of experience with scoping in Sublime Text and TextMate. And to my knowledge, the PHP .tmLanguage already includes scopes for function calls. I'm not a PHP expert by any means, but I know the basics, so I made three examples of different PHP function calls:
Green highlights a large variety of function calls in different languages. In the top example, baz_quux is scoped as meta.function-call.object.php, in the middle example it's meta.function-call.static.php, and in the bottom it's just meta.function-call.php. I don't understand where you're getting variable.other.property.php from.
However, if I take away the parentheses after the function calls above:
I get the following scopes, from top down: variable.other.property.php (aha!), constant.other.class.php, and constant.other.php. If I put the parens back, and add a space or three after the end of the function name, they are still highlighted as functions, in green.
So, while we had some fun with regexes today, ultimately your work has already been done for you. If you're going to be doing more scope-hunting, I highly recommend the ScopeAlways plugin, which, like its name implies, always lists the full scope of the current cursor position in the bottom bar (you can turn it off via the Command Palette if you want). If I get a request to expand my color scheme's highlighting to a new language, I just open up as much code as I can find and poke around with my mouse, looking at the different scopes, then editing my theme to correct colors as needed, or add new ones for brand-new scopes. I then scan through the .tmLanguage file (after converting it to YAML) and see if I missed anything.
Good luck with your work!
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 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.