The IntelliSense Completion list can get unwieldy in large projects. This video shows how to use the icon tray attached to the Completion list to filter the list by types, structs, namespaces, events, methods, or properties.
- [Instructor] When you're working in code in Visual Studio, you have this helper called Intellisense. It's actually a group of items that are lumped together under this umbrella term, and the one I want to look at today is called the Completion list, or sometimes it's called the Autocompletion list, and that's the dropdown list of suggestions you get as you're typing, and it's context aware, so it knows what language you're in, and what part of your code you're in, so if I'm inside a method like this and I type in Va, I'll get Var and a lot of others items that have the letters Va in it, but Var is one of the key words in c sharp.
If I'm outside of this method, I'm going to type in va, I'm not going to get Var because there's no key words that I can use at this level of code that have the letters Va in there. And if I'm at the end of the line, like here I want to say new, and I hit the space bar, and you see Book there, you won't see Var here either, because it doesn't make sense at this point. So that's the intelligent part of the autocompletion list.
But what I want to talk about today is what Microsoft's done to enhance the actual autocompletion list itself. So if you look at this dropdown, when you start typing and it gives you suggestions, at the bottom of the list is this thing called a Filter, that's what I'm looking at, it's called the autocompletion filter, and this lets me look for just items that are interfaces, I can look for just classes, I can look for structures, I can look for enums, and I can look, well I have to turn off these items.
You're probably thinking to yourself, the interface has disappeared. Well because this is a toggle, so when you click on it once, they appear, and then you click on it again, they disappear. So now I'm only looking at classes, now I'm only looking at structures, now I'm looking at, you guessed it, enums, delegates, names/faces, and then finally keywords. I think you can see the use for this, if you know it's a class or struct, and you've got lots of things on your list you can quickly get to just the structs, turn this one off...
And see a filtered list. Let's go back and put the book type in here. This also works when you're working with members. So I'll look at HistoryBook. So now I'm looking at members of a type, so the filters are just these three items: Properties, there's the properties of the book class. There's the events of the book class, and then, yes you guessed it, these are the methods of the book class.
You also might have noticed as I was hovering my mouse over this, there is some keystrokes to filter, so if I do an Alt V while I have this autocomplete list up, Alt V, it's going to filter down to just the events. So the takeaway from this is autocomplete works as it's always worked in Visual Studio, but now you have the ability to filter the list so you can see a subset of that giant list of suggestions.
- Installing Visual Studio 2017
- Using debugging features
- Reviewing document navigation enhancements
- Examining IntelliSense Improvements
- Using XAML tools
- Reviewing the tooling added to support Docker containers
- Debugging without the hosting process
- Using the Visual Studio 2017 Installer