 You know Kendra, I'd love to have you on the show, but you've just recently talked about all the things that are new in Visual Studio 2019. So what do we do? Well, there's a lot of stuff that's not new, but people might have missed in Visual Studio. We could talk about that. That's a great idea. Great. Hi, welcome to Visual Studio Toolbox. I'm your host Robert Green, and joining me today is Kendra Havens. Hi. Hey Kendra. It's good to be back. Welcome back on the show. Should I introduce myself just in case? Sure. Okay. I'm Kendra Havens, Program Manager on .NET and Visual Studio. Excellent. That's all I had. Okay. So you spend a lot of time speaking and showing off, and showing off things that are new in the product. Yeah. So we just shipped to Visual Studio 2019, and you of course were featured prominently in the launch, and you speak at things like Build of course, showing what's new in the product, in the latest version of the product. Yes. Because of course people want to know. Very newest thing. Yes. It's definitely what people want to know. But at the same time, we know there's all kinds of things that have been put in the product previously. Yes. That people may not know about. Yeah. And sometimes I always want to bring these up and touch back on things that are just really, really useful that we almost never talk about in all of the newer talks. Right. Because people are so focused on new things, but there's still great productivity tips that I want people to know. So I'm excited we're doing an episode on them. Cool. So we're going to talk about things that are in Visual Studio. Yes. That can help productivity. And they may have been there all along. They may have been introduced in the previous version. Is there anything that's literally new in 2019? There's all this stuff. Old. Yeah. I believe I will cover some of the Git changes in Control Q. Control Q now indexes a lot of Git commands. So you can search them. It'll pop open your Test Explorer. I'll show that in a second. And some of these I just learned about like two weeks ago, even though they've been in the product for many years. And I've worked on the product for many years. And I still just don't find them immediately. There's all this stuff to learn. All right. Cool. Should I do an apology? Like, sorry if you've heard this before. And you can mock me if you already have known about these things forever. But why not cover them? No, I think the rules for having a good show are get good guests. Don't do all the talking and never mock your guests. Not even a little bit. You can tease. I do well with adversity. OK, should we launch in? Let's do it. OK, so the first things I wanted to show. Oh, and first I'll introduce you to my solution. So this is my Productivity Features app. This is open source. Everyone can go download this. This actually has all of the quick fixes and refactorings that we have added in previous releases. Oh, nice. So yeah, you can scroll through and how to trigger them. So it also contains all of the code that one would need to trigger these, which is sometimes what people are trying to find. So something like wrapping parameters and that kind of thing. That is the wrong keyboard shortcut. Let's see. Control dot wrap every parameter. So it just gives you an example of how to trigger all of these things and instructions on where your cursor needs to be, because some of them are really contextual. So just kind of a helpful thing. You can get to this by using it's in Kendra Haven's Productivity Features on GitHub, or you could use an aka.ms link slash net features 2019. So that'll also take you right to the repo. OK, so introduce my repository. The first thing I want to call out are a lot of just general navigation tips. I really love this Navigate Backward Control minus. I'm sure you've used this some. Yes. Right? It is just really nice to go to wherever your cursor was previously, and kind of understand where were the last times that you were changing code or writing anything. And how far back would it go? Oh, gosh, I don't even know. A lot. OK. That actually finished with me, so it was three. But I'm not sure. I might have only just opened the solution. Yeah, so I'm not sure. And I can even do a dropdown and go back to where I just was, which is kind of cool. That's cool. So it keeps some navigation history. Maybe it is limited at five. Let's see. Well, five would be fine. Five is well enough, right? Sure. I'd be happy with it. Let's see. Oh, it keeps going. Excellent. Not sure what the limits are. All right. OK. OK, this one is another big one. I have a few things associated with the Solution Explorer. So you can sync with your active document. It is also Control Open Square Bracket S, which is difficult to remember, but we also have this icon right here in the Solution Explorer. And it's another one of those that I think this has been there for years. But I still get people asking about it on Twitter, so it's fun to call out. So whatever document you have open, I can Control Open Bracket S, and it hops to highlighting that file in the Solution Explorer. It's also just lovely. So that's sync with active document. And you can just trigger this in a one-off basis, or there is actually another setting that you can permanently turn on to always track the item that you're on in the Solution Explorer. And is it off by default? Mm-hmm. OK. You're like, why did we do this? Well, I'm sure. Yeah. No, we have good reasons. We don't want things to get around. There are two things that happened. One is we asked a lot of users, or B, we flipped a coin. I'm predicting it was the former. Who knows? No. So I think this is really helpful. So if I select that, and then I switch to a different document, you can see that the highlight also automatically changed in the Solution Explorer. So you might not want all that flickering in the Solution Explorer. Yes. OK. Yeah. And you can get there again by just track active document. And I'm going to uncheck that because I'm actually, I don't want it on all the time. I don't need that much selection happening all the time. OK. Speaking of more navigation, I also did learn about this on Twitter from one of the people on the, I believe he's on the editor team, but it is Alt-Tick. It opens a special context menu that is different from right click that has specifically more editor commands in it. So if you forget any of these, like go to Complaining Block, go to Next Issue and File. That's like navigating through what areas you have and that kind of stuff. There's Navigate Backward. I'm going to definitely cover Go to Last Edit Location, also a really good one. So if you right click on that in that spot, what do you get? You get an entire menu. So if I right clicked here, totally different menu. This is Run Test. We still have Find All References and some stuff. But the, yeah. Alt-Tick. Alt-Tick. And the tick is the, oh, what is the other word for that? Apostrophe. It's the weird apostrophe. The tilde. It's on the same key as the tilde. Yeah, you're right. OK. You're absolutely right. That's a good way to explain that. I'm sure it has a name. Tick. Well, he is a tick. Yeah. What was he doing? I think it was Alt. I think it was Control-Tick to open the terminal in VS Code for a pretty long time. That's how people, it's that same key. All right. Cool. In case people know. So, yeah. So in case you, OK. This is another one of my things that I love. So did you know, you can right click on a project node in the Solution Explorer and Open File and File Explorer. Open the folder. I knew there was a, yes, I think I knew that one. So this actually wasn't bound to any command. But I went ahead and bound it to Control-O-O so that it opens up really quick. I had been doing terrible things for years before I discovered this. So I would try to open. I would have properties open all the time. Go find the file location. Which was so silly. So it'd show up here. And I'd do something terrible, like trying to copy this full path. And then I'd try to go over to my, just wasn't a good life. No. It wasn't a good life experience for me. And then when it do anything or tried to open that particular file, so I'd have to delete the file name to actually go to the folder. Yep. Yikes. It's a lot of work. Why Kendra? Why would you be doing this? There should be a shortcut to do that. Your life is so much better. Right. So I mapped this shortcut myself. And I can go ahead and show you all how to do that. If you don't have a shortcut right now, it's just right click on any folder or project. So you can't right click on any of the files in general and do this, which I don't know. Maybe we could fix that. And it's open folder and file explorer. So my next trick is how often are you using a keyboard shortcut? Or there's a command that you know was a keyboard shortcut. And you're trying to find it again. And you're trying to find what's mapped to everything. Me personally, I don't use that many keyboard shortcuts because it's hard to remember. But when I do memorize, I want to use it all the time. Excellent. Oh yes, like code cleanup. Control K, control left, control K, control E. I use that all the time. But me, I can only remember like four. No worries. Totally right. So if you're ever wondering what a particular keyboard shortcut is mapped to because when you trigger it, you're not using it in the right context or it's not doing anything, you can always type. You can go to, sorry, Tools, Options, Keyboard, Environment, Keyboard. Remapping them. And you can type them. And make it more, I should actually do that. I should remap a bunch. And you can show because then I could do control R1, right? And my top 10. Yeah. And then you know it's always something in the keys or whatever. So this is how I know what I've already mapped something to or if I'm trying to map like, if I'm trying to map something new and I want to do something but I don't want to break an existing key binding. So I just wanted to check like, oh, what's currently using like control-slip-slash? And it's like, oh, toggle block comment. I actually don't want to use that. That's one in the next one I'm going to show off, sorry. Yeah, you can always check what a shortcut key is mapped to. And then we were doing open folder. So this is the open folder and file explorer command. And I can just search it here. And then I can see what keyboard shortcut it is already bound to. And have I wanted to bind it to a different one? I don't think I will because I'm going to forget it. Because I really like control-o-o because that's what I figured out. That would be an awesome. But. That's the coolest joke. Yeah, that's how you do it. So you can use someone's machine and remap all their shortcuts. Awesome or mean? Cruel? Terrible? No, no, it's OK. It's just because my life might revolve around keyboard shortcuts just a little bit. It's tough. Anyway, so have you ever read this text in the Search Explorer? I literally had a bug file. Oh, sorry, I clicked on it. This control semicolon. I had a bug file to like, why can't we just jump to that search bar in the Search Explorer? And why can't we just have a keyboard shortcut that does that? That's a great idea. And we do. And it's been there. And I agreed with it. And I was like, yeah, we should add this. And eventually someone who knows what's going on in Visual Studio got back to me and was like, yeah, we've had that forever. So then you change the bug to improve discoverability of the existing shortcut. Right. And their response was obviously, this is part of the main experience of Visual Studio. Like as soon as you open Visual Studio, the text search solution explorer control semicolon is right there on the screen. And you still missed it, Kendra. But it's OK. This is why we're talking about it. I'm sure other people have been also seen this. Cool. OK, so here's another one that I just want to call out, specifically for folks who, I don't know, are finding themselves in this situation a lot. So let's say you have a .sln that you're trying to open with Visual Studio, but you have about 50 versions of Visual Studio installed. And I can actually distinguish between if this is 16.0, if this is 16.1. These are obviously previews, but I don't know which preview. One of them is my internal build. For extension owners, one might be their specific version that they are also currently building. And that's just the build they have on their machine. So just a note, we always order these from oldest to newest. It kind of makes sense, because I have 2017 installed right there in the preview, so you can kind of see how we're ordering it. But it's just a good way to make sure you don't feel like you have to guess. OK. So I really appreciate that. Cool. So I think we can move on. So I have some more navigation, some more just helpful stuff. I tried to group these logically. I couldn't find a way, because they're all just little things. Cool stuff. More cool stuff. Even more cool stuff. That's how I'll do it. So clipboard. You can actually see your clipboard's history. You've used this? I think Mads showed that a few episodes ago. Oh, good. OK. So I guess I don't need to show a ton of it. But I should have made this in quiz form. How many of you know what keyboard shortcut you want to access your clipboard history? But yeah. So that's Control-Shift-V, which I love, because it's Control-V is obviously very much already associated with clipboard in our minds. So good on you. OK. So this one I actually do demo a lot. It's Control-T-R, which opens the files I've recently had open, or rather just opens a page where I can see the files I've recently had open. So it's Control-T, and then you just type an R into this search box. So normally, Control-T is like, yeah, I go to files, members, types, whatever. And we recently added R. We're going to recent files, which, again, just super cool. OK, so I'm not sure if I showed Control-Shift-Backspace, which is go to last edit location. So it's a bit different than navigate backward, because that's just, I believe, the last place that I had my cursor. But Control-Shift-Backspace is actually where I last edited code. Also just super nice to have. So if I add in some spaces there, I can kind of hop around. Nice. Yeah. OK, so this is one I'm sure you probably know. Let's see if I can actually find my string for this. I had like a nice little, there we go, multi-carat. So multi-carat, do you know the keyboard shortcut? Now I'm going to quiz you. No. Control-Alt-Click. You can click in multiple places in your editor and add some text wherever you clicked, even if it's on the same line. And if I click out of this, when I Control-Z, it'll undo each of the places I had this complicated carat. And that was Control-What? Control-Alt-Click. Control-Alt-Click. If you are a mouse user and you want to do that. If you instead are editing something that has a lot of things that match it, you can use Shift-Alt-Dot to highlight things that the matching carat, which is also really cool. So if I wanted to change all these two suggestions in my editor config, I can just do it. I suppose that works in XAML, doesn't it? It is an editor-wide feature. Because that would be cool if you decided you wanted to do a different color everywhere. Like over here? Let's see. Styles or something. Well, it won't. Oh, how about after every? Oh, no, Shift-Alt-Dot. It does. Yeah. Nice. Gosh, doesn't that feel good? Love it. I love on-the-fly demos. Just saying, I am using a preview build right now that's internal. I get those all the time. No. So you don't have to. OK. So that was multi-carat. And if you ever forget, I do think those keyboard shortcuts are really difficult to remember. We do have Edit multi-carats. Oh, OK. So you can kind of see Shift-Alt-Dot and Shift-Alt-Comma. Yeah. Sweet. Yeah, sweet. That's pretty nice. We should add Control-Alt-Click to that, though. Maybe that's somewhere else. Anyway, it's OK. You get the general idea. Multi-carat's really nice. I think I demoed it in Preview at the last build. And I demoed it again in more of a subtle way. We were also just editing the Editor config. And we got a lot of ooze from the audience. And I mean, I didn't say anything, but it's been there for months. But it's OK. That's OK. Everybody loves this. It doesn't matter when it arrives. It's there now. Definitely. OK, so generally, I just feel like you should know, I am a really big fan. I'm becoming more and more of a big fan of the Team Explorer. When I first started using Visual Studio five years ago, I was like, I really just need to stick to the command line and get bashed and everything. That's what I'm really, really comfortable with. But more and more often, they keep adding these little features that are really getting me. I should probably give this feedback directly to the team. We'll just make an episode on it. So if you hit Control Q and you're now typing Git commands, you can actually find these in the Team Explorer. So if I just type enter, it automatically opens up the changes tab. Wait. Wait, what? Show that again? OK, so Control Q is like the general big search. That was like a big thing built and everything. You can do a lot of things. But now, if you type Git, it actually has menu commands that will actually open this part in your history or your Team Explorer. Oh, that is so cool. Right? It's not bad. I really like that. That's awesome. So if you know the Git command and now you're in Visual Studio, not necessarily wanting to be typing the commands, but you know you want to do something, that will show you how in Visual Studio to do it. Yeah, and the great thing is, it is so cool. We're geeking out over here. This is a fun episode if only we watch it. Anyway, the great thing is, if I type Git commit, it doesn't actually do a Git commit. I can still see what all the changes are currently and then I type a message or whatever and that's when I would hit commit. So it just opens up the Visual Studio pain where you would do this thing and it doesn't just automatically, which is really nice. OK, so speaking more on the Team Explorer, how many times did I set up very well for this? Yeah, so how many times have you actually made a lot of changes but then you realize, oh, crap, I'm still on master. I'm going to branch my code and then do the changes and then make a commit. And then once my branch is good, I'll merge it into master. More than zero, less than 100,000. Right, so you can actually stash changes super easily. So I'll just stash all of these. Oh, I'll go ahead and save these. Right, I can quickly create a new branch and I'll say my feature branch. Oh, sorry. No spaces. Why would I be using a space? Get it together, Kendra. OK, cool. So now I can go back to my changes and I can, one sec. Oh, shoot, did I forget how to do this already? Sorry, I am super new to using this. Do you have to do, do, do, do, do, do? So you stashed them on master. Oh, there it is, sorry, right in front of me. Oh, OK. OK, so I want to go ahead and pop these, right? So now they're all back and now I can just do a first commit to feature branch. I did not know that. All of that anticipation was planned. I knew where it was the whole time. Sorry, so it ends up in this little stashes node and you can just right click on it and pop it. And I can do all of this from the command line but then I'd have to go to the command line. And honestly, this is just really nice. Also, it's way more visual that I can actually see what changes I'm making. And before I even do that, if I could actually, maybe I'll just go back to master. Nah, that doesn't really matter. All I really wanted to show was if I've made a bunch of changes in places all across my code. So let's do shift dot dot, let's do suggestions, all of that. You can see them adding up over here in changes. And I can easily click on these and it can open an UbiDiff showing the distinction. Another thing on our UbiDiff, oh, I think this is just spaces. Let me make a bigger change and just delete something. Do something like that. There we go. So our diff viewer is actually really cool in Visual Studio. You get a lot. I believe you get full intelligence when you're typing while you're still in a diff, which is just cool. So you have all of these editor features. Because there's just the editor. You can get IntelliCode. You can actually debug a test, which is just wild. And if you install pull requests for Visual Studio, and it's an extension right now, super sweet, you can easily pull your coworkers PR and their code onto your machine. And you can actually debug their GIF, which is wild. I'm not sure if we've fully planned all of it to work that way. But UbiDiff does just inherit all of the great editor features in addition to having this plus and minus changes type viewer. And it just gets all of them. So you're still syntax highlighting and all of that, which is so much nicer than viewing it in the browser. I'm a huge fan of this kind of stuff. UbiDiff. Yeah, sorry. I keep saying that. I guess we just call it a diff viewer. What's the Ubi part? I'm trying to remember where that came from. Eviquitous? Could be. Sorry. All right. I hear the teens talking about it, and that's why I used it. I think they actually did tell me once in a demo, like it's OK if you don't call it a diff. Nobody knows what that means. Anyway, yeah, Team Explorer kind of sneaks up on you with how useful it is. I think they've added a bunch over the past few years, and give it a shot, guys. I did, and I'm really happy about it. That was very cool. Totally get command line, get bash user. That's all I wanted to do, but it's nice. All right, one of the super common requests that I get is actually how do you, let's say I have a block of code, and I want to insert it all the time. Can't we have some sort of refactoring or something pop up that I can just input this code block anywhere I want? And that's where I say, do you know what feature I'm going to talk about? Quizzing you, sorry. I'll take off the pressure. So how is this different than a snippet? It's a snippet. It's a code snippet. So this is Control-KX, and I just get, thanks. Thanks for letting me put you on the spot. See, this is why I ask you to be mean to me. Well, all right, I'm going to be mean, because you still can't highlight, right-click, save as snippet, right? Right. Yeah, OK, let's not go there. Let's not go there, let's not go there. We do have nice, like, so you can create your own snippets. That's another thing I wanted to call out. We have a lot of stuff built in. Let me, like, choose one that I want to insert. So it'll just insert whatever you kind of select there. And it also will have, like, certain things highlighted. Let's do, like, a test. And, yeah, I could just, like, insert a test method or whatever. I don't have this using in my code, that's why it's causing an error. But just kind of one of those helpful things. We have a lot of pre-built ones. You can also make your own with the create a snippet. Not as easily as Robert would love us to. Create a code snippet. I wouldn't have been surprised if this auto-completed. Yeah, because I've been to this page so often, trying to link it in bugs that people open. So, yeah, you still have to kind of write some odd XML. But then you get to trigger, like, oh, I want these certain parameters to auto-fill. So I can insert my snippet, hit tab a couple times, so I can rename and customize it as I want. If you know which fields you're probably going to want to customize. So that's pretty cool. Along the same lines, and I really like this one, is surrounds with snippets. So this is, have you used this one before? Control KS will surround things like that. So now I have, like, another for each loop inside of this. That is cool. That's pretty sweet. I kind of want to, like, do this more, looking for places where it won't cause errors. But Control KS, again, so I can, you know, create a region, which is really nice. So I think that's actually, that's a super helpful one, because people are constantly doing that. Or we even have, like, if statements. That's going to be, there we go. It's just really clean, really fast. OK. So those are all the little things that I had. We can move on to preview features if you want. Nope. We have time. No, let's stop now. OK. Let's just do stuff that's shipping. That's all you get. You can see preview features in other videos. This is all about stuff you should already know about, or that I should have already know about. We'll put the blame on me. That's good. Cool. These are awesome. Wow. So we will, in the show notes, we'll list all the things you showed, which is great that you took notes, so you can easily do that. I already have them written down. Excellent. And all of these things are shipping today, and many have been in the product for quite some time. Yeah. The little things that you didn't know about. We should do more of these. Let's do more of these. OK. All right. Thanks for having me on the first place. Awesome. Thank you. Hope you guys enjoyed that, and we will see you next time on Visual Studio Toolbox.