>> On today's Visual Studio Toolbox,
Allison shows us how Visual Studio can improve your coding speed.
>> Don't worry, we won't get too crazy,
I'll keep it intellisensible.
>> Excellent.
[MUSIC]
>> Hi, welcome
to Visual Studio Toolbox.
I'm your host, Robert Green,
and joining me today is Allison Buchholtz-Au. Hey, Allison?
>> Hey, how are you?
>> Great, welcome to the show.
>> Thank you.
>> First time guest?
>> Yeah.
>> Excellent.
>> I'm very excited to be a guest here today.
>> It's awesome. So we're going to talk
about some more Visual Studio productivity tips and tricks.
Last week, Kendra, was on showing us some of
the things Visual Studio does to add to productivity,
but we focus on the IDE.
>> Okay.
>> Today, we're going to focus on coding,
is our part two of this, particularly around IntelliSense.
>> All right.
>> But as we go along,
I'm sure you're going to talk about other things.
I've been using the products since it was invented,
but just practicing I learned two or three things.
>> I know, I'm excited to see you.
>> There's cool stuff to see.
>> Yeah. It is pretty exciting that in our practice,
there's already two things that you did not know.
>> Yeah.
>> So I'm excited to share those with you.
So I think first off
it probably makes sense just to talk about what even is
IntelliSense for any viewers
who are just starting to get their bearings in Visual Studio.
I definitely had no idea what IntelliSense was.
I was like elicit some intelligent thing
that's going to help me unlike it definitely is.
>> The name it imply?
>> Yes, yes. But IntelliSense,
I always like to think of it as sort of
like our version of auto-complete.
It's giving you suggestions,
it's giving you options.
It's not quite like the auto-complete
on your phone where you only get three suggestions.
It's really about giving you
everything that might be relevant at that point.
>> Right. It's not so much
an auto-complete because it doesn't guess what you meant.
>> No.
>> It doesn't just make stuff up.
>> Exactly.
>> Therefore, get half of it wrong.
It says, is this what you meant,
if so you don't have to do all this typing.
>> Exactly.
>> Yes.
>> As many of our developers know,
so much of our time here on
the Visual Studio Team is about saving you those extra keystrokes.
>> Yes.
>> Because those add up.
>> They add up.
>> You save someone,
one keystroke a minute when they're at
their machine for eight hours a day like that compounds.
>> Yes.
>> So IntelliSense is really meant to help you do that. All right.
So let's take just a quick example here
to see what IntelliSense does.
So I'll zoom in here.
You'll see this box here that just appeared
when I typed f. So this is our IntelliSense box.
Right now it gives us any suggestions that might be what we want.
So you'll see here.
>> Including the codes snippets.
>> Including a code snippet.
>> That was one of the things that I did not know.
>> Yeah.
>> Twenty minutes ago.
>> Yeah. So I know you're a big code snippet fan.
>> I am.
>> IntelliSense does have code snippets,
and actually if you were to press this button down here,
it would filter to the code snippets that match if,
which I think is pretty cool.
So what's pretty agree is that
IntelliSense will try to
highlight when it thinks it's most likely.
So in this case, we've got a perfect match with if.
But we also have things like I
custom formatter so it does CamelCase matching.
It says, hey, maybe you want an I format table.
It does matching on a variety of things here,
cell you've got members and
classes and interfaces and it'll search
everything in your code base to give you a list of suggestions.
>> Right.
>> That might help you out. You can just scroll through with
the arrow keys or with
your mouse depending on how you like to code.
>> Right.
>> Cool. So now, it's gone here.
If you ever accidentally get rid of your IntelliSense window,
you don't have to backspace and retype it to get it back.
You can just do Control-Space,
and it's back again.
So here you'll see we've got classes, delegates, namespaces.
These are all filters.
Let me go ahead and zoom in there real fast.
So these are all IntelliSense filters.
So I mentioned, it pulls a wide range of
things from your code base to help inform you of what you'd like.
But in this case,
there's a ton of them.
If you wanted to filter them down,
you can either select any of these filters with your mouse,
or they all have shortcut keys available to them.
So if we were to activate that again,
you'll notice when you hover over them, Alt-C,
I did that here, would do the classes.
You can always escape to get out of it.
>> Cool.
>> I think that's pretty great.
Then I know one of the other things I was showing you
today is if you have your IntelliSense Window here.
Maybe we're not in an if loop,
maybe we are in a method,
we're trying to fill in our parameters.
There's an example, but it's
hidden behind my IntelliSense box here.
What would you do? Normally, like escape more.
>> Escape or hope that it fades.
>> Yeah.
>> Then wish that there was a way
of getting it to briefly disappear.
>> Well, do I have a trick for you.
If you just hold down Control,
it would go transparent
enough for you to be able to see the code underneath.
>> I love it.
>> Which, again, one of those hidden gems.
I use this all the time when I've got
a really unwieldy method that's got a ton of parameters.
>> Right.
>> I'm trying to look at the example right underneath it,
and it has saved me so many times from having to exit out,
write it down on a piece of paper,
like adding a bunch of enters.
>> Or scroll the window or something.
>> Yes.
>> Yeah.
>> That is exactly right.
So that's a nice,
I think, quick overview of IntelliSense.
Another great thing, let's see if I go up here.
You'll notice we have some regular expressions up here.
Unfortunately, we're in our GA release of Visual Studio right now.
But in our latest preview,
we actually give you IntelliSense off of regex expressions.
>> Wow.
>> Which is pretty cool.
But what I think is even cooler about this for our users [inaudible]
>> That's coming in 16.1.
>> 16.1.
>> Not far away.
>> It's not that bar away. I actually think
that might have been released last week.
>> Oh.
>> Maybe.
>> Okay.
>> The previous definitely out.
>> Okay.
>> 16.1 might be out fully.
But it isn't 16.1,
if we were to try and activate IntelliSense,
if we're in 16.1, it would give us
some nice little IntelliSense there.
>> Cool.
>> But what I think is sort of cooler about this is that,
you're not just getting IntelliSense
for regex because we decided to.
There's these great things called TextMate bundles,
and those allow for
any language to add into their language service,
and it allows you to get simple colorization
and simple IntelliSense for that language.
So things like Go, right?
It has a TextMate bundle for
Visual Studio so you get basic IntelliSense.
So you don't have to just stick with
the languages that our team's support stay in there.
>> Right. So that's an extension
somewhere you get that in the marketplace.
>> It's part of just like,
if you open a folder with Go,
Visual Studio just knows that there's
a TextMate bundle for that, and pulls it down.
>> Okay.
>> It will give you that automatic colorization.
>> Yeah. Cool. Right.
>> That it is. Which is really cool.
>> Yeah.
>> It's great to know that IntelliSense
is not just something we support for our own native languages.
>> Right.
>> But for our community,
like Visual Studio is really a tool for developer.
>> Right.
>> I'd like to think.
>> Yeah.
>> Cool. Let's see.
One other great thing that we get with IntelliSense
is this little box here which is our signature help.
>> Yeah.
>> So it gives us a little bit of information about
what this method might do, and I don't know about you,
but I definitely don't know all the methods
and what they do off the top of my head.
>> Yeah.
>> So it gives you
information about the parameters you'll have in there,
or the arguments you'll have in there.
It gives you a little bit of a description of what it will do,
and even if those are your own private classes.
As long as you have those descriptions as part of it.
>> Right.
>> IntelliSense can bring those in.
>> That Window became color-coded,
I think in 2017.
>> I think so.
>> In 2015, it was just all gray.
>> Was all gray.
>> Yeah.
>> It was really hard to tell where things were separated.
>> Yeah.
>> But we've tried to make it a little easier to scan.
>> Yeah.
>> Cool. So that's
typing great things to help you have less keystrokes.
>> Yes.
>> Another thing that I like to show and I don't always
helps me code a little bit
faster is the ability to navigate rhythmically.
So I know what last week you guys learned about GoTo?
>> We did navigate backward.
>> Navigate backwards.
>> Then go to last edit.
>> Okay.
>> We did those, but that's not all of them.
>> That's not all of them. Yeah. So those
involved you flipping back and forth.
>> Right.
>> Between different files, right?
>> Yeah.
>> But sometimes I feel like,
I just want like a little peek into
what this method is doing without having to leave my context.
So what I can do is I can go right-click
"Peek Definition" which is also Alt-F12,
your keyboard junkie, and it gives you a peek into this file.
So here, I can see what's specific emoji does.
I can investigate how it works.
Great thing is that IntelliSense also works within this window.
>> That window is editable.
>> Yeah, you said.
>> Totally right points in there?
>> I do believe you care.
No, you cannot.
>> Oh.
>> Yeah.
>> There you go, there's my feature request for the journey.
>> All right. I'll be sure to relate that to the team.
I thought you could, but apparently not.
>> Okay.
>> But yeah, it's totally editable.
I can go backspace here,
bring up IntelliSense, if it says yes,
we want to do our success,
and I can even save it,
and if you are watching closely,
emoji search up here also had that little star go away.
>> All right. Cool.
>> Yeah. So I think those are it's one of my favorites.
If you want the full files
flipped so you can investigate more fully,
you can also just do "Control click".
>> Yeah.
>> Which is go to definition that's been around.
>> Which is also F12, if I remember correctly.
>> It is F12. So F12 will bring you to the file,
Alt-F12 will give you just the peek.
>> Right.
>> So hopefully, a nice complementary keyboard set.
All right. Yeah. So that's just a quick overview of IntelliSense.
>> Awesome.
>> I hope anyone who either
has been using IntelliSense for many years learn a new trick,
and anyone coming to Visual Studio for the first time,
this was a better understanding of why it's such a powerful tool.
>> Yeah. That's great. So can I ask you a question.
So looking ahead, what are some of the things
that we can expect to see moving forward in IntelliSense?
If you can share some future stuff with us.
>> Yeah. So one of the coolest things I think and
I'm definitely a little biased because it's my area.
But we just released
for general availability something called Intelicode,
which takes IntelliSense and
supercharges it, as what we like to say.
>> Right.
>> So it takes all the great things
about IntelliSense and producing your keystrokes,
and takes it to another level by
infusing it with machine learning.
>> Right.
>> So we take the wisdom of the community
of over 2,000 open-source repositories,
and instead of just an alphabetical list,
we give you a starred recommended list.
>> Okay.
>> So it takes your context into account in order to give
you much more similar to autocomplete where it says,
"Hey, this is probably what you want next,
and it's not just an alphabetical list."
>> Like this is the 12th project in a row that
you created a method like this.
You just want me to autocomplete the whole thing for you, please.
>> We're a little far away from that.
>> But that's like where you
could see it ending up someday, right?
>> Fingers crossed.
>> Right.
>> But yes. Yeah. We notice you're using this class,
and within an if statement you always call this method.
That's a thing we tend to do?
>> Or I can potentially detect anti-patterns, right?
>> Maybe soon.
>> Maybe. Okay.
>> Maybe soon, we're hoping.
There's a long road ahead.
>> Okay.
>> I will be excited just to do a deep dive of that with you.
>> We'll definitely do that in a few months
when it does a little bit more-
>> Stability.
>> I was going to say when you thought about it more,
you've seen how it's being used,
you've get a sense of what it can do,
and then we can talk about how it works,
but also some tips and tricks on using it.
>> Absolutely.
>> Then we can talk about science fiction,
future worlds where this thing can go.
>> Sounds great. Yeah. I'd love that,
and maybe we'll be extra lucky,
and we'll finally have that Code Snippet on-demand for you.
>> Probably won't be like a clippy thing which says,
"Hey, it looks like you're writing an expense report app."
>> Hopefully, not. We're going to try to avoid becoming a clippy,
but hopefully people will find it a little more useful
than a non machine-learning IntelliSense.
>> Yeah. Totally, and we've seen a couple of demos of it,
and we had Mark,
Wilson Thomas on the show a while back.
>> Nice.
>> Giving a preview of it it's really really cool stuff.
So we'll definitely revisit that.
>> That must have been like a year ago.
>> Probably.
>> Yeah.
>> We've come a long way in a year.
>> All right.
>> Awesome.
>> Thanks so much for doing this.
>> Thanks so much for having me on.
>> Hope you guys enjoyed that,
and we'll see you again next time on Visual Studio Toolbox.
[MUSIC]