PHP Eclipse - Do not select $ when selecting PHP Variable - eclipse

I have recently been using PHP Eclipse and have got everything set up the way i like it with just one exception.
When i double click on a variable it also highlights the $ which makes it difficult to move to the next occurrence if it is later used without the $ as part of $this as an example.
Does anybody know how or if this can be achieved?

Just use Ctrl-F and search for the exact text you want.

Related

Netbeans 12.1 not applying code assistance properly on C headers

I recently updated Netbeans from 12.0 to 12.1 on my Ubuntu 18.04 platform and I have noticed that code assistance has stopped working on C header files (*.h). Among other issues:
Selecting a hyphenated name like MY_C_MACRO by double clicking on it doesn't work; it only selects a token from the name ("MY", "C" or "MACRO") instead of the whole word.
Ctrl-clicking on a name doesn't switch to the definition of that name anymore.
Auto-tabbing doesn't work anymore (hitting ENTER brings the cursor to the beginning of the next line instead of placing it below the previous line's beginning.
Typing /** and hitting ENTER doesn't automatically insert the template for documenting the symbol below anymore.
Has anyone found the same problem and know how to fix it?

Add parentheses around C-expression in Eclipse

Is there a way to select a C/C++ expression in Eclipse and put a bracket around it with a single keyboard shortcut? IDEs usually have this but I couldn't find a way in Eclipse.
For Java Code, there is a more or less good workaround described in Parentheses over selected words in Eclipse, but this does not work for C-Code - after bringing up the template list for the selection, the suggested templates are empty.
As far as I know, exactly that is not possible. You might report it to Eclipse CDT as a feature request.
But as workaround a template like the following can be used:
(${line_selection})${cursor}
If you hit Shift+Alt+Z the Surround With Quick Menu shows all templates containing ${line_selection} and with a number key a templated can be selected.
The key Shift+Alt+Z can be changed, but unfortunately no key can be defined to select the template directly. Also unfortunately, this does not work for multi-line selections because everything in the template in the line before ${line_selection} will be applied to each selected line.

How do I modify the EL opening template in Eclipse?

Whenever I am working in a JSP file and I type ${ to start an el (Expression Language) tag, Eclipse will automatically add } (with a space before the closing brace) after the cursor so that I get ${ } instead of ${}.
Is there a code template in Preferences that I can modify to change this behavior, or is it beyond user preference control?
I have checked in Preferences: Web: JSP Files: Editor: Templates, but none of those templates match. I've also looked in several other sections in Preferences but haven't found anything promising.
What #Mero provided (see comments on answer above) might not be an exact answer, but creating a JSP Template probably the closest thing that I've found.
A few notes for anyone that wants to go that route:
Create a new template through menu Window->Preferences, then in the drill down menu navigate to Web->JSP Files->Editor->Templates. Click New.
Name is a shortcut you can type (the same way typing sysout ctrl+space in Java is a shortcut for System.out.println()). I suggest something simple like el. This allows you to type e l ctrl-space instead of $ { ctrl-space to pull it up.
Context tells it when it should appear in intellisense. I suggest creating two of this template where one has a context of JSP Attribute value and the other has a context of All JSP.
Description is just informative. Put whatever you want. I put 'EL Script' myself.
Pattern is where you put what will be inserted. Put $${${cursor}} or $${${script}}, depending on preference. See below for explanation on the differences.
In Eclipse Templates ${} is how you put variables in the template, so to make it actually print ${} you have to escape the $ with a $$ leading to $${}.
The predefined variable ${cursor} defines where the cursor is after intellisense replaces the el, so to have the cursor appear in between the curly braces you want to do this: $${${cursor}}.
Using any variable that is not predefined (in this case, ${script}) will simply put in that variable with a box around it and allow you to type over it and press enter when you're done, allowing you to move to the end of the closing curly brace.
Note: I understand that this is not an actual answer, but rather is a workaround. I'm putting it here simply so that those who are fine with a workaround can know how to go about doing it.
Edit
For those that don't like having to type ctrl-space, a workaround could be to have the template name start with< since on JSP pages, the < opens the intellisense, so for instance, you could have the name be <el or <$.
A workaround but not an answer:
Disable auto-close of EL tags. You type ${expression} and get ${expression}|, rather than typing ${expression and getting ${expression| }. (| denotes the cursor location)
See this answer, from when this same question was asked of Eclipse Kepler: https://stackoverflow.com/a/20258401/1021426

Remove blank line in Eclipse

How can I remove lines that only contain spaces when using Eclipse Find/Replace prompt. I checked the "Regular Expression" check box, and tried the following, neither of which worked.
^[:space:]*$
and
^\s*$
Find: ^\s*\n
Replace with: (empty)
sry this might be an different answer but you can set the number of blank lines you wish to have after fields, methods and blocks in the formatting dialog of the eclipse preferences. then you can hit ctrl-shift-f to automatically format your code depending on your custom definitions.
have fun!
I was suprised that for XML files edited with Eclipse there is a good solution:
Select the checkbox value named 'Clear all blank lines' in Formatting panel
Window->Preferences->XML->XML Files-> Editor
Save and use the "Ctrl+Shift+F' shortcut
The blank lines will dissappear!
for the find/replace operation, "\n\r\s" regex will work on windows, for unix based system, "\n\s" can be used
as already suggested, you can format your code by Ctl+Shift+F
for manual work, locate a blank line and press Ctl+D (Cmd+D on Mac) <- gives u satisfaction of killing the line with your own bare hands :)
cheer!
This one worked for me for years:
Replace this: [\t ]+$
With nothing
Hope this helps!
Many thanks to lamamac.
In genereal, when you want to do search replace with regular expressions in eclipse the $ sign doesn't work as it should.
Use '\s*\n' instead of '$'
As already suggested, regular expression and replacement is the solution, but such response would have been saving some minutes to me:
click on ctrl+f
use this replacement:

Eclipse: Can you put your cursor on all lines?

In IDEA you had the possibility to put your cursor on all lines.
Is this possible in Eclipse?
Eclipse 3.5 should have a column mode (which is what I think you're asking about) - use Alt+Shift+A:
http://update.eclipse.org/downloads/drops/R-3.5-200906111540/eclipse-news-part1.html#Text
I haven't tried this since I'm stuck at version 3.4.1 for the time being. There's a patch that claims to work for 3.4.0 (http://tkilla.ch/column_mode/), but it's not working for my 3.4.1 install.
If you refer to the ability to select a group of lines (like a all function), you can use the outline view
alt text http://publib.boulder.ibm.com/infocenter/radhelp/v7r5/topic/org.eclipse.jdt.doc.user/whatsNew/images/drag-and-drop-outline.png
From there, you can move/rearrange/delete all block of text.
If it is about column mode, see my answer here.
alt text http://update.eclipse.org/downloads/drops/R-3.5-200906111540/images/block-selection-mode.png