How to copy watch expression value in eclipse? Whenever I use "Copy Expression" from drop down menu it gets me something like this '"System.currentTimeMillis()" (pending)'. Is the pending part should have been the value of system time?
This worked for me:
Select the expression, right click and disable.
Then copy/paste as normal
Then right click and enable
Should get something like this (and you can just delete the disabled tag):
"System.currentTimeMillis()" value (disabled)
Could not find a way to do this directly - but here's a workaround:
Use
System.out.println(YourExpression.foo())
Then you can copy the output from the Console.
Related
When copy a file ".env", I hope to got a duplicated file named ".env 1" not ".env copy"
You can change this behavior by setting the explorer.incrementalNaming to smart.
To do that, do the following:
cmd+,
search for: explorer.incrementalNaming
Change the setting to smart.
Otherwise, if you don't want to change the setting, you can just constantly change the filename after copy is complete. The fastest and most efficient way I found is through the following keyboard commands:
Select file in Explorer
ctrl+c (or cmd+c if you're on a mac)
ctrl+v (or cmd+v)
<enter>
right arrow once
backspace 5 times
then put in 1.
I'm currently working on a project and an I used several print commands in order to see if all is going well.
But all these prints take some execution time and since the program is running well I was wondering if there is a way to comment or delete all of those commands at once.
Generally you can perform a "Replace in Projects...".
Presuming you code in JAVA:
Goto "Edit > Replace in Projects"
Set "Containing Text" to System.out.print
Set "Match" to Literal
Set "Replace with" to //System.out.print
Choose your Scope (Project)
Hit Continue
It is easy as that. Not even a need for Regular expression.
Have Fun.
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
Coming from .NET background ...
Is there a way to either via key stroke or by automatic settings to have the "Import" statements added that are needed by the code?
Right now I have to right click each class that I am referencing and choose the add option to have the Imports added and that's slow. I'd like to do them all at once with a single key stroke
I found that SHIFT COMMAND O does the job.
In Eclipse Helios with Android extension, Ctrl+Shift+M works for this purpose.
You can see what you particular key binding is by going to Window->Preferences->General->Keys and enter "import" in the filter widget. Look for "Add import" in the search results.
If it is bound to a key sequence, you can use (or change ) that sequence. If it is not
bound, you can bind it to a key sequence.
+ SHIFT + O for mac users. Had me stuck for a bit but works.
Is there any watch window to see variable value in XCode during debugging?
Can we check value just typing variable name as in watch window?
On mouse over, I can't see value for dictionary type objects.
I see "Variables View" option but it has only first option enabled.
in "Debugger" window, I can't type variable name.
Watchpoint stops your program when the value of an expression changes. But I have to see value during breakpoint.
Let me know what is the best way to debug.
Thanks
Alternatively, you can click the two little arrows in the mouseover description and select print. You can then see what the dictionary contains in the console.
Use the Expression window. Run:Show:Expressions... Just type in the entry field the variable name or expression . You can also right click/hold on a variable name and in the drop-down menu select "Add to Expression Window".