Angular 2 Code Snippet extension (from Mads) not working in VS 2017 - visual-studio

I should have quite a lot of snippets available to me but when I type in "ng" I am not seeing them. All I get is what is in the below image. Is there a chance Resharper can be overriding it? If so, does anyone know how to resolve it? I have not been able to research a solution so this was my last hope.

Default key for using an non resharper snippet when resharper is installed is ctrl k x that should bring up the menu.

There are two ways to invoke Visual Studio's own code snippets when using ReSharper.
If you want to show VS's own code snippets menu, set your own shortcut for "Edit | Intellisense | Insert Snippet" item (via VS options -> Environment -> Keyboard).
If you want to have VS's code snippets in code completion, you can override code completion to come from Visual Studio instead of ReSharper. Go to ReSharper | Options | Environment | IntelliSense | General, and set code completion type to 'Visual Studio'. But please note that this disables ReSharper's own code completion.
ReSharper will include Angular 2 live templates since 2017.2, created a ticket for that: https://youtrack.jetbrains.com/issue/RSRP-464025.

Related

Disabling the Automagic Property Name "Helpers" in Visual Studio / Resharper

How do I get rid of these bits highlighted in yellow that keep auto-appearing (like a codelens feature):
I just got a new computer so this is a fresh install of both VS and Resharper - I have been unable to determine which is responsible for this "feature", but I hate it.
Anyone know how to disable it?
This is a ReSharper 2018.3-introduced feature called Inline Parameter Hints. In Visual Studio 2017, go to (your menu choices may differ slightly, but you'll get the idea...) Tools | Options | ReSharper Ultimate | General and click Options. From there you will see a screen similar to this:
You can customize the behavior of this feature there.

Refactor menu missing from Visual Studio 2015

I am having trouble finding the right-click context menu in Visual Studio 2015. I know that nothing is wrong with my project or the file I am working. I can find the right-click context refactor menu in Visual Studio 2013. However, in Visual Studio 2015 there isn't a refactor context menu in the right-click context menu.
Where did it go? How do I get it back?
Your suggestion cannot include menu Edit → Refactor.
I have tried to reset my Visual Studio settings back to default using menu Tools → Import and Export Settings and that didn't bring the menu back either.
Some of the refactoring tools have been relocated or are at least accessible in a different manner than they were previously.
Using the extract method refactor as an example, you can still use this function; it is just not done the same as before:
Right click
Quick actions
Click extract Method
I think they've changed it to feel more "ReSharper"ey. All of the functionality should still be there however.
Here's more information on refactoring in Visual Studio 2015 - hopefully this helps! Refactoring (C#)
You no longer need to access the refactoring using the mouse right click.
It is recommended that you use the keyboard shortcut keys within Visual Studio.
For all possible shortcut keys, see Default Keyboard Shortcuts in Visual Studio, Refactor.
You might need to build the project to get it to work.
See Code Editing ASP.NET Web Forms in Visual Studio 2013 | Microsoft Docs. (If it is missing then the point is that I am using an example provided by Microsoft.). In Refactoring and Renaming see To extract a method in a C# page. When I follow the instructions I cannot find the feature to extract the code to a method. When I tried the Edit menu it said I did not have valid code. Then I built the project and the feature to extract the code was available and worked.
If you change the name of the object you are refactoring, the light bulb then appears to the left which asks if you wish to change the name of the object (i.e. refactor) or generate a new constructor for the new named object.
Ctrl + . is the shortcut key for extracting a method in Visual Studio 2015 and onward.
Ctrl+M, R does not work anymore in new versions.

VS2013 IntelliSense overlapping ReSharper's one

After installing ReSharper I've noticed a problem with the IntelliSense;
In the image it is clearly visible that the IntelliSense of Visual Studio is displayed over the one of ReSharper (which by the way has the focus, so using the arrow keys will move the highlight section of the completion list below).
I've tried to do several things without any result (always with VS restart):
Switch from ReSharper IntelliSense to VS (back and forth)
Limit ReSharper IntelliSense to some selected languages (i.e. C#)
Completely disable VS IntelliSense ('Tools | Options | Text Editor | All languages' and 'Tools | Options | Text Editor | C# | IntelliSense')
Resize ReSharper's completion list
Re-applying the keyboard shortcuts (Visual Studio)
Reset VS and repairing the ReSharper installation
Re-install ReSharper
Clear all temp folders
None of them helped me fix this issue which results in a particular annoying problem while trying to write anything.
JetBrains ReSharper 8.2 C# Edition
Microsoft Visual Studio Professional 2013 Version 12.0.30110.00 Update 1
This is a conflict with the "plain text completion" feature of the Viasfora extension. It's been fixed in source by detecting when ReSharper is installed: https://github.com/tomasr/viasfora/issues/51 Should be fixed in a new release soon, I guess.
If you have this problem without the Viasfora extension:
Go to Tools -> Options -> Text Editor -> XML -> General
And Disable "Auto list members" and "Parameter information".
seems that resharper disables this features in xaml, but not in xml.
Worked for me with vs2015. Hope this helps.

Adding a Visual Studio toolbar button for a command that is only available as a keyboard shortcut

This question relates to this ReSharper YouTrack issue.
In Visual Studio 2010 with ReSharper 7.1.1 installed, if I go to Tools > Options > Environment > Keyboard, there is a command called ReSharper_SilentCleanupCode.
I would like to bind this command to a toolbar button.
This seems to be impossible using Tools > Customize > Commands because the only commands available within this dialog are for actions that already have an associated menu item. The particular ReSharper command I'm interested in (Silent Code Cleanup) doesn't appear in any menu, so it cannot be assigned to a toolbar button using the "GUI".
Is there any other way to bind a keyboard-only command to a toolbar button? (One of ReSharper's programmers thought the "VS script editor" could be used, but I'm not having any luck finding info on this.)
Edit
I should have mentioned this in the first place. While azhrei's macro solution is great for Visual Studio 2010, it will break once I upgrade to VS 2012, because macros are no longer supported. If someone has a solution that will continue to work in VS 2012, that would be preferable. (Or perhaps VS 2012 toolbars don't have the same limitation in the first place?)
Add a macro that executes the command, then add the macro to a toolbar.
This works because it makes the keyboard-only command appear in the Macros menu in the Customize Commands dialog.
Details
Add a macro which does this:
Sub _ReSharper_SilentCleanupCode()
DTE.ExecuteCommand("ReSharper_SilentCleanupCode")
End Sub
Put this macro in a module which appears in Customize..Commands..AddCommand..Categories..Macros, such as Samples or MyMacros.RecordingModule, but not MyMacros.Module1 (the default when using the macro IDE).
Go to Tools..Customize..Command and select the Toolbar you want.
Now Add Command... and select the Macros category.
Select your Macros.Samples._ReSharper_SilentCleanupCode macro.
Click Modify Selection and change the name to #-) or whatever text makes you think ReSharper Silent Code Cleanup without being too long for your toolbar. :-)
I tried this with Visual Studio 2010 and ReSharper 7.1.2.
Edit
Visual Commander is a apparently way to get this going on VS2012 as well - see comments below for more.

Visual studio 2010, how to use code snippets in a method call

I moved from Visual Studio 2008 to Visual Studio 2010.
My code snippets work good in Visual Studio 2010 on the start of a line, but not when adding parameters to a methodcall. This did work in Visual Studio 2008.
So when i type this : "DoSomeMethod([nowiwantmycodennippets!]", the code snippets are not in the intellisense list.
Does anyone know if this is a setting, or just not working anymore, and if it can be fixed?
This appears to be bug. If you type your snippet name (i.e. noiwantmycodesnippets) and press ESC to dismiss the completion list (if open), then you can press Tab to insert your code snippet. So it's just a matter of the code snippets missing from the completion list.
You can use the Control+K, Control+X key chord to show the code snippets' list also. But this isn't as nice as using it through the completion list.
Are you using ReSharper? If so, Resharper Intellisense overwrites the VS default one, so that i.e. code snippets do no appear in the completions. Try turning off ReSharper Intellisense in the ReSharper Options (Environment->Intellisense->General, choose Visual Studio).
If ReSharper Intellisense is a must, you'll have to create a ReSharper "Live Template" which opens up for "code snippets" behaviour, only ReSharper is way more advanced -- see for example this one http://www.brianlow.com/index.php/2009/04/06/resharper-live-templates-for-nunit/.
On my machine I just type "public void Test(" and than ctrl+space and type the name of my snippet. Works like a charm. I've got the C# keyboard shortcuts, I think.

Resources