I am trying understand hot xamarin code templates work and how to use it.
By reading the manual it appears the a user can select the code templates by clicking on it or hitting enter on it. Just like in eclipse and intellij.
But this seems not to work the same way in xamarin.
For example after I typed "try" in the editor and hit ctrl+space to get the code complete. Now I am presented with options to select. When I select try and click or hit Enter on it nothing happens. The code complete window just closes and the template is not added.
The animated gif demonstrates it with the mouse click event. But the behavior is the same for key events. Also no matter what I template I select it is never pasted.
You need to press tab key after you have selected the text. You basically have to press tab - tab. The first tab will complete the try text in your example. You may have only typed in t or tr. The second tab key press will expand the code template.
The behaviour is similar to Visual Studio. The difference is that Visual Studio gives you more information in the completion window that appears telling you that you need to press the tab key twice. Screenshot from Visual Studio is shown below.
With the screenshot above pressing tab once will close the completion window but not insert the code for the try template. Pressing tab again will insert the code template text.
Related
Please see the GIF below:
I am using Visual Studio Code. By pressing Enter and Ctrl + Shift + Enter. I can make the auto indent in the next line.
So, I guess there is a more convenient way or package which can accomplish that by just pressing Enter.
In preference->editor search for autoIndent and make it full
I resolved this problem by switching Language Mode from Django HTML (for some reason it was auto detected) to HTML.
Press Ctrl+Shift+P (or directly press Ctrl+K, M => Select HTML)
Print 'Change language mode' and press Enter
Select HTML
I'm not sure if you are still having this problem, but I stumbled across this other post that seems to have a solution:
Visual Studio Code Auto close tag and indent XML as with HTML
Hopefully this is what you're looking for.
EDIT: I've just realised that this causes the language mode to be changed to HTML, which may lead to unexpected/unwanted behaviour. It suits my needs, however.
I have modified the Emmet preferences, I'm not sure if it's a good solution, but it works.
In the preferences, search emmet.includeLanguages
Click Edit in settings json
In the right column, click on User settings
Add "emmet.includeLanguages": {"php": "html"} on the last line
In Eclipse you can double click next to an open brace and that selects the block of code, however in Visual Studio you need to press the CTRL+SHIF+]! How can i edit this shortcut so that simply a double click does the same thing? (holding too many keys is just too much)
To change how the text editor interacts with the mouse, you'll have to develop a Visual Studio extension. Or, you can just change the keyboard shortcut to perform this action to whatever you like. You can do this from Tools/Options/Environment/Keyboard and select the command Edit.GotoBraceExtend. Enter the new shortcut in Press shortcut keys by pressing them then click Assign and OK.
Note that if the shortcut you have selected was assigned to some other command, the assignment will change.
Try ctl+m+m anywhere in the code block. This will collapse the code accordingly and then you can copy
I'm using Visual Studio 2010 Professional, and created a WTL Project (Dialog). In this dialog, I inserted a Tab Control via the Toolbox. However, after placing it on the dialog window in the Designer/Resource Editor, I just can't add any tabs. There are several issues:
In some video tutorials and the MSDN, it says that the Tab Control starts with two tabs, which switch when clicked. However, the Designer shows five tabs, which don't switch when I click them.
Aforementioned tutorials also suggest to edit the TabPages property in the property pane. However, I can't find such a property in the property pane.
When running the Test Dialog (found in the Format menu), the five tabs are visible, and they are also focused/switched when clicked. However, running the program, there's only the plain Tab Control pane without any tabs (white square).
How can I add a Tab into the Tab Control via the Designer, i.e. not dynamical?
Let's be good stackoverflowers and answer the question properly.
The visual basic tutorials do not show the same dialog resource editor you are using for your WTL project. Although, the video tutorial that is most closely related shows how to add a tab control using this editor; it does so by altering the MFC code. It runs the program to show the result; it does not show the tab inside the resource editor.
Thus, the conclusion is that tabs cannot be added using the dialog editor on its own.
I've created a MACRO in visual studio 2010 that builds my project and attaches it to several processes. Unfortunately, unlike in vs2008, I can't add it to a toolbar so I can run it with a press of a button; after looking it up I found out the guys at Microsoft left the option of adding a macro button out of vs2010:
http://social.msdn.microsoft.com/Forums/en-CA/vsx/thread/87455de6-2a7d-42dd-b51f-ddd442c3e3fd
Am I wrong and there is a way/workaround that can solve this?
It's possible. Tools + Customize, Commands tab, Toolbar radio button. Use the combo to select the toolbar you want to change. Add Command button, Categories = Macros, select the macro in the Command list. Modify Selection to alter the button properties.
What you can't do is select an image for the new button. That's indeed stunningly lame, looks like they just didn't have time to get it done. You can add your vote to this feedback article. But surely on the todo list for the next version already.
Like Visual Studio, I want the code completion menu to popup immediately after I start typing.
I don't mean the completion inline - I mean I want the same window that popups when you press esc to appear.
Is there anyway of doing this?
The code completion settings are in Xcode Preferences (shortcut: command-comma) -> Code Sense. I don't think you can make the actual pop-up list (as oppose to the completion line) appear without hitting escape.