I don't know if it's possible, but i want to change some of the defaults intellisenses. For example when i write try and press enter, the IDE puts the catch ex as exception and the end try, but i want that the finally word it's added too.
it is not really intellisense, this is more an issue of "autocomplete" where the ide will fill in some of the code.
You can do this with a snippet though. I have attached the snippet that will do what you want.
All you need to do is save this file to disk (its a .snippet file, but really its just XML)
then in Visual Studio you go hit
Ctrl+K, Ctrl+B
to bring up the snippet manager. You will see a button for import, so you can click that and select the TryCatchFinallyEndTry.snippet file you downloaded from my attachment.
The way you use a snippet, is that you type its shortcut in the IDE and then hit TAB (not enter)
so the shortcut I made for this snippet is TCF (for Try Catch Finally)
so all you have to do after this snippet is added to your library is type
TCF {tab}
and the IDE will insert
Code:
Try
Catch ex as exception
Finally
End Try
*NOTE - I have to zip the .snippet file because the forum doesn't support uploading that extension right now.
Do TryCF and then hit tab. That will create a try catch finally block.
good to see it was built in. I use a 3rd party snippet editor, and I am not sure what snippets are included with VS, and which ones were included as part of the snippet editor I use. I guess TryCF was a built in one.
Here is the link if anyone is interested. It is a free app written by a VB MVP
That's a cool app. And while on the subject of IDE AutoComplete I am wondering if that app can do some property functionality. (Or maybe something similar is built in?)
Lets say I have a class. Making properties is kind of annoying so I would want something that could do this:
Code:
Public Class MyApp
Private _strProperty As String 'Hit tab and it does this:
End Class
"AutoCompletes" to:
Code:
Public Class MyApp
Private _strProperty As String 'Hit tab and it does this:
Public Property strProperty() As String 'replaces underscore as property name
Get
Return _strProperty 'returns variable tabbed on
End Get
Set(ByVal value As String)
_strProperty = value 'sets variable tabbed on
End Set
End Property
End Class
that is why the snippet editor Bill made is cool. If you do some common thing you are typing over and over again, you can build your own snippets to insert whatever you want.