Stop Eclipse Automatically Closing/Completing Comments - eclipse

When working on C code in Eclipse (Mars, in case that matters), I type /* to begin a stream comment. If I hit [Enter] any time within this stream comment, Eclipse automatically inserts a column of single-space indented stars _* and a single-space indented close stream comment _*/. This is incredibly annoying as this is never the behavior I want after opening a stream comment. I then have to undo-undo or highlight and delete.
I've gone into C/C++ > Editor > Typing and unchecked every option in the Automatically close group-box, but these options only include "Strings", (Parentheses) and [Square Brackets], <Angle> brackets and {Braces}.
There's no /*Comments*/ option.
I've even tried modifying every code template that contains such a stream comment, to no avail.
How can I get Eclipse to stop auto-completing comments?
I've checked these similar questions and found no answer:
Annoying eclipse automatically closing quotes, Stop Eclipse from mangling my comments, eclipse disable completion of xml comment, How to stop Eclipse from auto-adding parentheses?

Related

Eclipse Ctrl+Shift+D not working With Pydev

When Using Pydev on Eclipse, I wanted to bind Ctrl+Shift+D Copy Lines and Ctrl+D to Delete line. But when I do so, the Ctrl+Shift+D doesn't work.
I removed all the other bindings of Ctrl+Shift+D but it doesn't work.
Fun fact, if I choose Ctrl+Shift+C, it does work, so I'm wondering where is this key binding used.
The problem arrises only in Pydev, ie. when I open the file in Text editor the bindings work.
This was fixed for PyDev 6.3.3.
The problem was that there was a command bound to Ctrl+Shift+D which was not visible there because it wasn't properly categorized.
I fixed this in: https://github.com/fabioz/Pydev/commit/422a0bde1d1a3ac5c091c00e88368a3bc3c0dc5f
Note that you could still override it if at the keybindings dialog you created a command and put the 'When' as 'PyDev editor scope' (which defines when it's active -- it wouldn't work without this because the hidden action had a higher priority given that its scope was narrower).
See details at: https://www.brainwy.com/tracker/PyDev/906

persisting the search queries in Eclipse

You ctrl + F, put in your rather complex regexp search/replace strings, run the queries, keep working on the code, then the next time eclipse needs a restart all that search/replace dialogue history is gone. Google again the internets for the right regexp syntax, etc. Pretty tedious. Is there a way to make eclipse persist those regexp queries form session to session ?
It seems what I am really after is a wayto have more than 10 entries in the search dialog. As the commenters say,Eclipse does persist the search history, just that it is a very short history.
Here is the duplicate that has yet to be addressed properly: Eclipse: How to increase find/replace history?

eclipse rcp keybindings don't work

I am trying to make eclipse keybindings work.
I tried to make the rename command work.
I looked at some tutorials and experimented. I enabled command and key binding trace in console (http://eclipsesource.com/blogs/2009/07/08/tip-tracing-keybindings-in-rcp/).
I have created a custom command:
com.mycompany.myproduct.command.rename
This is what I got so far:
1) I tried to follow this tutorial,http://www.vogella.com/tutorials/EclipseCommandsKeybindings/article.html, but I came to the conclusion that this is for e3. This is because you need to add commands plugin that recognize only old e3 handlers. No xmi is involved
2) I tried to use xmi binding contexts. I had my command registered in the top level commands tree and connected to a handler in the top level handlers tree.
In the binding tables section I have a bindingTable that works in Dialog and Windows context. I added a key binding. The sequence is "F2" and it is connected to my custom command.
When I hit F2 I get the following message in trace:
COMMANDS >>> execute >>> starting: id=org.eclipse.ui.edit.rename; event=ExecutionEvent(Command(org.eclipse.ui.edit.rename,Rename,
Rename the selected item,
Category(org.eclipse.ui.category.file,File,null,true),
org.eclipse.ui.internal.MakeHandlersGo#1285594,
,,true),{},Event {type=1 Tree {} time=1480412218 data=null x=0 y=0 width=0 height=0 detail=0},org.eclipse.e4.ui.workbench.modeling.ExpressionContext#177fc1a)
In short the default eclipse IDE rename command is fired (my key binding does nothing), and nothing happens on my application.
However, if I change the sequece to "M1+1" and hit ctrl + 1, a little pop up comes up that lets me choose between "quick fix" (eclipse IDE command) and my rename. If I choose rename the handler fires.
Now, how do I disable eclipse IDE default keybindings. The instructions of the tutorial in step 1 definitely don't do it.
Thanks!
You can try to force E4 to read your key binding as an user one, adding the "type:user" tag to the KeyBinding itself :
I swear sometimes it seems like the application just likes to see us suffer. I had the same issue you had; a while ago my key binding was working just fine and today I notice it doesn't work anymore. Thanks for this post I found 2 solutions:
"type:user" from the above comment
remove org.eclipse.ui from the run configurations; it seems this was added when I pressed add required plugins after adding some plugin myself

Using IntelliJ IDE to autocomplete line and place semi-colon

In eclipse you can hit "enter" and the IDE will automatically take you to the end of the line and place a semicolon.
In IntelliJ, if you hit shift-enter you get similar behavior minus adding the semicolon. I have read and tried cntrl-shift-enter and you get the exact same behavior. However, that is such an awkward key combination to be using all the time, at least much more so than the one-button approach using Eclipse.
Any ideas?
IntelliJ autocomplete escape
In InteiJ IDEA use (Ctrl-Shift-Enter) for "Smart Autocomplete".
It will end the line "smartly" with a semicolon as you wish. It also works in a few different situations like IF statements of FOR loops.
Why don't you redo the key binding?
Go to: (spanner icon) Settings -> Keymap -> Complete Current Statement and rebind how you will (for example, ctrl-enter might suit you better).
Or there's also a default keymap set for Eclipse that you can choose. I'm not sure if it affects the complete-current-line action, but you could take a look.
you can also use ctrl+shift+space
if you want always have it just do this

Clearing output from Scala Worksheet

Every-time you save a Scala Worksheet in the Scala IDE, the output of each expression is printed as comments on the right-hand side of the editor. Is there a way to clear this output from a Scala Worksheet so that you can cut and paste code?
Currently, my solution is to save my worksheet with an error, so that the output would disappear. There must be a better way... a keyboard shortcut or something.
There is no such feature yet. There is a related ticket: The Format action should strip comments.
While waiting for the ticket to be resolved, this regular expression can be used in Find/Replace (Ctrl/Cmd+F) to delete the comments.
*//[>|].*$
Update:
This has been fixed: #132
It's jerry-rigged, but gets the job done.
Make a small edit (e.g. delete a space where it doesn't matter) to prompt a save.
Save.
Press Esc immediately to terminate worksheet process.
You now have a clean worksheet!
Ctrl+Shift+C does the job in Scala IDE 4.7.0
Alt+Shift+A enables Block selection mode. You will be able to select only left part of screen (columns with code). Block mode also makes possible to select only columns with output.
More on block selection mode