Watch window for XCode debugging - iphone

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".

Related

Eclipse - Debugging

I am very new to Selenium and Eclipse.
I have a question (actually 2 questions) about debugging.
When I am debugging in Eclipse (Version: 2021-06 (4.20.0)), so I do not get visibility of all variables I have defined in the method.
For example, (see the screen shot attached) I have added string variable testSigned and assigned a value to it. Actually the purpose is to verify the text value contained in web element table_AdditionalDocumentation.
I defined Toggle Line breakpoint at line 395.
I started to execute in debug mode, got to the line 395.
However, I do not see the value of testSigned in Variables tab.
I noticed it does show values only of the variable which would be returned by the method, correct me if I am wrong.
Please, tell me how to get those values I have defined visible.
2.Additionally, please, let me know which button to press if for example after line 395 I want not to go line by line (F6), but just to run the code to the end.
For the first question, I'm not certain, but it might be because you haven't initialized that variable with a value. Try setting it to an empty string on the declaration line.
For the second question, if you set a breakpoint on the line you want to get to, just Resume (F8), and it will stop at the next breakpoint it hits, hopefully the one at the end of your method. Alternatively, if you just want to stop at the line right after the method returns (which will show the return value), you can click "Step Out" (F7) for that.

VSCode - enlarge pop-up object inspector

Working in python in VSCode. Making heavy use of the object inspector (if that is what it is called - see image below) -- the window that appears with object/variable contents when hover mouse over variable name in code.
It is quite a small window and I often find myself wishing it was larger, or that it could be dragged/resized.
Is there a user-setting or other method to change the default size? Make it much larger?
It is actually very simple. If you want to inspect variable (object, class, ...) 'foo', just type 'foo' into your debug console's command line and press enter. You now got the same interactive output from the fly-out in the more persistent and resizeable debug console window.

How to trigger documentation popup in vscode

How to trigger a popup with documentation for identifier under the cursor?
Normally it appears when hovering the identifier using the mouse pointer:
I would like to achieve this effect using a command or keyboard shortcut.
The only related commands I found are: trigger completion (which doesn't show the function doc) and trigger parameters hint (which only works when the cursor is inside function call - parameters list).
This is the editor.action.showHover command. It is bound to cmdk cmdi by default.
Note: Shortcut works by holding down the cmd [ctrl in windows], then while holding press k then i
You can change the keyboard shortcut with a keybinding such as:
{
"key": "cmd+k ctrl+space",
"command": "editor.action.showHover",
"when": "editorTextFocus"
}
The default shortcut for Trigger Parameter Hints is Ctrl+Shift+Space
You also have, with VSCode 1.40 (Oct. 2019):
Definition Preview Hover from the keyboard
There is a new command Show Definition Preview Hover for better accessibility of the definition preview hover widget, which can be triggered by hovering a symbol with the mouse and pressing a modifier key dependent on the platform and configuration.
Previously, only the command Show Hover was provided, which is equivalent to hovering the mouse cursor over a symbol.
Now, with Show Definition Preview Hover, the detailed hover information can be shown via the keyboard.
To make this more graphic, check these steps:
In Visual Studio 2019 for Mac, I couldn't find anything about "hover" in the Key Bindings setting. The relevant command seems to be called "Show quick info" and is bound by default to Cmd + F1.
I know this question is about VSCode but I could only find this question when trying to search for an answer. Therefore I would also like to leave the information here in case somebody finds it useful.
There are multiple ways to trigger the documentation popup:
First: Using shortcut ctrl + space
Second: Using vscode extension:
Here is the documentation:
Each answer here demonstrates a different function. Below is a consolidation of every type of helpful popup, the context in which they come up and all the ways I know to trigger them.
These assume default settings.
Function: Display documentation
Shortcut: Ctrlk Ctrli
Scope: Works over named elements - variable and function names (does nothing over literals).
Can display function documentation:
or variable or even property information:
This is the same pop-up you get when you hover over the element briefly.
Function: Display parameter hints.
Shortcut: CtrlShiftSpace
Scope: Works inside a function call.
The cursor must be inside the parenthesis that contain the passed arguments. Does nothing outside that scope.
Can also be triggered by typing a comma, as if passing another argument.
Up/Down arrows can be used to cycle through overloaded definitions (instead of moving the cursor up and down the document).
Function: Display the code completion menu
Shortcut: CtrlSpace
Scope: Anywhere. Will adapt to the context. In strings will display words only. In code will offer symbol hints - function names, variable names within the current scope, known properties, etc.
Is case insensitive.
Matches all contained characters - they do not have to be consecutive (see image above).
Tab or Enter accepts the currently selected suggestion.
Symbol hints can be triggered by just typing letters. Inside strings you must use the keyboard shortcut.

How to copy watch expression value in eclipse?

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.

Tell Eclipse to auto-complete only method name?

Let's say I'm editing a line...
obj.fooBar(x, y, z);
I want to change the method name to fooSomethingElse, but keep most of the arguments. If I delete all or part of the name, and then use content assist, it completes the method name, but starts a new arg list...
obj.fooSomethingElse(arg1, arg2)(x, y, z)
^---- this arg is highlighted for editing
I often have to delete "(arg1, arg2)". I can turn off "fill method arguments" in preferences and then I only have to delete "()", but it's still annoying. Is there another command to complete only the method name. Ideally it would just be a separate command and key combo from the general purpose content-assist, so I can invoke either one as needed.
Essentially you are looking for a way to toggle between inserting and replacing via content assist. The default behavior is to insert. You can toggle this behavior while inside the content assist selection dialog by pressing and holding the Ctrl key while selecting the completion.
More inforation - http://blog.deepakazad.com/2012/06/jdt-tip-toggle-between-inserting-and.html
I think you just need to press tab instead of enter to autocomplete it. Then it will keep your existing parameters.