Visual Studio Toolbox

Developer Productivity in VS 2015 and VS 15

Developer Productivity in VS 2015 and VS 15
5 (100%) 1 vote
(Video Transcript)
[SOUND] Hi. Welcome to Visual Studio toolbox. I’m your host Robert Green and joining me today in the cozy confines of Studio B is Casey Wunutz. Hi Casey!

>> Hi. How are you doing?

>> Welcome to the show.

>> Thank you. Thanks for having me.

>> Casey is a PM on the dot net team?

>> Yes. And you are gonna show us all kinds of fun stuff inside the current and the next version of Visual Studio.

>> Yes.

>> That helps developers become more productive.

>> Yes.

>> Which is a feature of every single version of Visual Studio.

>> Right.

>> Since when Visual Studio was invented.

>> Correct.

>> So if anybody asks you, well tell me about the next version of Visual Studio. You say, it makes you more productive than ever before. And you’re always true

>> [LAUGH] Never lying when you say that.

>> [LAUGH] Never lying. And then when someone say, give me some examples. Well, watch Casey on cool bot she’ll show you.

>> There you go that’s it

>> Cool

>> Yeah, so obviously one thing that we’re focusing on for Visual Studio 15, is developer productivity, and really digging deep into it when you’re typing in the editor. How we can make you more productive, and so that’s really what I’m just gonna show today, is all the things we’ve been working on for that.

>> Okay, so you’re gonna-

>> And then-

>> Does it start off with the next version and then bounce back and forth between versions, the current and the next?

>> Basically, I’ll just show you what’s in preview two and then maybe some stuff that’s coming in the next preview and what will be in RTM for Visual Studio 15.

>> Right.

>> But then a lot of the features I’ll show will be in Visual Studio 2015.

>> Okay.

>> And people just don’t know about them.

>> All right.

>> Or they haven’t discovered them yet.

>> So, we’ll try to do a good job of making clear what things are in the current product.

>> Right.

>> What things are coming?

>> Yes. I’ll try to call them out if they’re coming soon versus in the product now.

>> Excellent.

>> Yeah.

>> All right. Let’s go.

>> So something that happened, or came out in Visual Studio 2015 Update 1, is the C Sharp interactive window.

>> 2015 Update 1.

>> Yes.

>> Okay.

>> I know the naming is a bit confusing here but this is 2015 Update 1.

>> So like in the fall.

>> Well, we have a long history of that. Because let me see if I can get this right. Dev 12 was 2013. Dev 13. No. Dev 13 was 2015. Dev 15 is the next one, right?

>> Right.

>> See

>> We-

>> You’re not even clear

>> [LAUGH] Well, I know that we tried.

>> Still 14

>> We tried to make to have 14aligned with 2014 and then we slept and came 2015 and then [CROSSTALK]

>> 14 is 15

>> Yes.

>> 13 is. 12 is 13. 13 was I don’t know.

>> Yeah.

>> See, I can’t even keep track of it.

>> Yep.

>> So VS 15 is the next version that’s coming out, okay.

>> Is the next version that’s coming out, yes.

>> All right, so.

>> And then 2015 is the current version that is out.

>> Right, but we digress.

>> [LAUGH] All right, so again in 2015 Update 1, something called the interactive window, which is basically just a REPL, which is a read, eval, print loop, where it’s basically you can just type in snippits of code and immediately get them evaluated. So, I’m gonna show you all that. The primary motivation behind the interactive window or REPL is to basically learn APIs quickly. As well as to learn that new language features quickly. So if you’re going from 2013 to 2015, and you wanted to learn C Sharp six and the new things in C Sharp six like string interpolation, you can use the interactive window to play around and see how it works.

>> Why don’t you just create a win format, put a button on it and then put that code behind the button?

>> Because that’s so much effort

>> [LAUGH]

>> To launch the C Sharp interactive window, we all know that tools options get pretty crazy and trying to find things in the menus is pretty hard, so something that has benefits to you for a while that not a lot of people know about is the Quick Launch menu, which is up here. And if you can actually just start typing in the names of things, like say, C Sharp interactive. And it’s going to find the things hidden under these menus for me. So, I can just go from here to launch it. And then I can just make it a little bit bigger, and then voila, I’m here. So, you can see it’s the most glorified calculator of all time. You can just type in expressions. So I could be like, cancel that. Right line. Oops. Hi channel nine, etc. It’s gonna print out. And so, among the top used cases is actually using this to explore API’s. So something you can do, is you can actually reference assemblies and DLL’s here. I think I have the path. No, I don’t. So, I have to get path to my DLL.

So, I paste it here. [SOUND] Then now I can do using Octokit.

>> Can you do the same thing with the framework classes?

>> Yeah, so I could just do using.system.whatever, and they’re already in here.

>> Okay, cool. All right. And if you need data reference, it’s Pound R and you need to know the path.

>> Yeah, you need to know the path to dl. Eventually, when we’re able to work on the interactive more, we’ll have NuGet capabilities built in better. So you should be able to do like Pound R, and then NuGet, and then the name of the package, then we should be able to download it for you.

>> Cool.

>> And make it a more seamless experience. But we don’t know when that will be coming yet, but that’s something we’re working on. So for example, here I have referenced the OctoKit library, I’m trying to learn how to use the OctoKit API, I can do

>> Which is-

>> It’s GitHub API, yeah, so its for trying to figure out how your Repo is doing or you can use it to help you automate pole request and stuff like that. So if your trying to learn it, a lot of us just take code snippets like this from the internet, the surface is having difficulty selecting. Okay. So you can select something from the internet, and then paste it and then I can just click enter and it’ll get immediately evaluated in here. And so it just helps you learn how to play with things and then you can see we have-

>> IntelliSense. It’s just like editing.

>> Yep. So it’s basically the editor, except now you can just click enter and every expression or statement that you’re typing in here is getting evaluated. So I get full IntelliSense EC, full colorization So it’s definitely a step up from the standard command line repel where you don’t get to see these things.

>> But you don’t get the full light bulbs and the whole.

>> You get light bulbs.

>> You do get light bulbs?

>> Yeah, I’m trying to think of what. So.

>> So if you put in a couple users, and you only use one of them, they gray out?

>> Right, so if I can like reset my context here and if I do pound. Okay, so something I can do, is use Alt+Up to navigate through my history. So I can use this to go back here, and then now let’s say, that I try to do my code snippet I should see a light bulb appear. Here, it tells me that I didn’t have my using in here and then it’ll do that and it will prepend it to my submission. And then, I can use Control+Enter if my cursor is anywhere to basically automatically submit what’s there.

>> Would it also work with code analyzers? There’s really no way to associate them with this project per se, right?

>> Yeah.

>> Yes, so one day, it will be there.

>> That’s a great idea, something we can work on.

>> Right, yeah. So interactive window is just this fun, playground environment for just playing around with things. So you can also do, I have caps lock on, and they can like learn string interpolation, like how it works. So, I don’t know. User by company? I guess by company. There’s no user associated here, I guess. But yeah, you can just play around with all the different language features and see how they work.

>> Cool.

>> Which is pretty awesome. So that’s the interactive there’s also the ability to get from the command line. So if I go to the Developer Command Prompt, then all I have to do is, once I’m in here, once it loads Is just type CSI which stands for C Sharp interactive. And then I’ll be dropped inside of the REPL from the command line. And so, I don’t need Visual Studio open for this at all. And then, I can do the same thing. And then, it’ll print out.

>> Cool.

>> Yep.

>> Cool.

>> Yeah, and also you don’t need to have a project open at all to launch a C Sharp interactive. So straight from the Start page, you can just load up the interactive window. Yeah, so that’s the interactive window, we all saw the Quick Launch up here to help you navigate through things.

>> So, it’s an even lighter weight way of learning than saying using studio code which is another way people might think to do that. Cuz you don’t necessarily want the whole big IDE with projects loading with just window where you can learn C Sharp. So this way, you can do it inside Visual Studio.

>> Right, yeah. It’s basically a lightweight way to interact with C Sharp.

>> Yep.

>> So you’re going to be also have something called a script file, which is a CSX file.

>> Mm-hm.

>> Where there’s no concept of a namespace or anything, and you basically just type asynchronous code at the top level without having to worry about public side void main or what a main space is. You can just start writing C Sharp code. So it’s basically, if you’re trying to teach someone C Sharp a nice introduction where hello world is one line. In the interactive window. Cool.

>> Yeah, so it’s great. So back to Visual Studio, so we’ve talked to a lot of developers on the .NET team, where we’re trying to figure out how to make people more productive. And so we found that a lot of people hate having all these windows open and seeing the menu. And so something that not a lot of people know about is Visual Studio actually has a full screen mode.

>> Mm-hm.

>> Where you can click, Shift+Alt+Enter, oops, Shift+Alt+Enter, Shift+Alt+Enter. My computer is so messed up right now. I don’t know what’s going on, all right. Shift+Alt+Enter, full screen mode.

>> There we go.

>> And then it’s gonna go full screen, it’s gonna put everything off to the side, and you have as much space as possible to work in the Editor.

>> Yep

>> And then from here what you can do which not a lot of people know about is something we have called navigate to, which we’re actually going to rename to go to.

>> Okay.

>> Because it’s more intuitive what it means cuz you’re going to something. You can type in the name of a file, a member, a symbol, a type in here. And you’ll basically be taken to that, and it will open up in the Editor. So for example, I know I have a file in here called CodeFix. So I can just type it in here, and I’ll see it in here. I can type any type, member, method name, etc, and we’ll see this. And it’s a one-stop shop for navigating. So you can see in here, you also have the symbols that tell what it is. So the C# icon is a file. This yellow one is a class. The box is extension method, etc. And so you’re able to see these things. And something that’s coming in Dev 15 is we’re gonna allow you to filter. So there will be an option to go to line from here or go to type or go to member or go to symbol or go to file, and you won’t have to see all this other clutter. I’m looking for a file here, so I should be able to only see the files that have CodeFix in them if I want.

So we’re gonna add that in the next version.

>> Will there be an MRU capability of that as well?

>> What do you mean?

>> Most recently used.

>> So we’re working on trying to make how this stuff is displayed smarter. I don’t know when MRU stuff will be in there, but it’s definitely on the like backlog of things that we need to do. Yeah, it’s like the most recently visited stuff, will be at the top.

>> Right.

>> Yeah, it won’t be in there that I know of next, but it’s definitely our future want that we have.

>> All right, cool.

>> Yeah, so then in here, there’s also Options. So there’s a thing called the Preview tab, which will basically show you as you’re hovering over different things, it’ll open it up.

>> Cool.

>> If you want that or not, and you can also search external items in here, or Show details. So if I do Show details, it’ll show me more stuff with regards to where the file’s located, and stuff like that. So here’s Preview tab where as I page through all the different ones, it’s opening up the file and highlighting where the terms are. Yep, so I wanna open this one and so while I opened up, it was really easy. The window disappears because now I’m in the Editor, so I can just immediately start typing. So that was navigate to, which will now become go to, which we triggered with Ctrl+, was how we brought that up.

>> Okay.

>> Also, wherever your cursor is in here, it will automatically populate it with that. So my cursor was on fixable diagnostic IDs, and I do that, and it shows up there. So maybe title is a bit of a better example where you can start to see all the different ones in there.

>> Cool.

>> Yeah, and so this concept of being able to filter out your results is something that we’ve now added to IntelliSense as well. So a lot of people are writing code in unfamiliar codebases, so if you’re working on an open-source project and you don’t really know what all the codebase is, you haven’t written any of it from scratch. And you’re just trying to play around and fix a bug, you basically don’t know what things are. Or you dot into things, you have no idea what’s going to show up. And so we’ve atomized the ability to filter your IntelliSense, so you can say, I only wanna see classes or only methods from IntelliSense to help you like learn codebases faster. Also if you have large codebases when you start typing IntelliSense, that completion list is gonna start to fill up so many different things because you have such a large codebase. And so what we’ve just tried to add this little icon tray to the bottom, which I can show you here, which will make things way easier.

So you can see as I’m typing, that there’s all these little icons here on the bottom. And so if I hover over them, it tells you what the icon represents, and it also gives you the keyboard shortcut associated with it.

>> That was gonna be my next question.

>> Yeah, so that you don’t have to use the mouse at all. Yep, so you can filter over all of these. So like here, I say, I only wanna look up properties. So I can do Altl+P. And then you can see it selected the property one, and I only have properties in here. Or I could do Alt+M and only get the methods and see all the methods in there.

>> That’s nice.

>> Yeah, then we also support camelCasing, which not a lot of people know about. It’s also supported in the go to feature. Right, you could say GS, and then I can see them bolded in here, which is what we call completion highlighting. Where you can see that the G like basically, so do you understand why you’re getting the suggestions like why is get semantic model below get syntax. We could see the GS is sooner, you can probably try to figure out how our completion algorithm works, which is kind of a great mystery.

>> Now that’s been in there for a while, hasn’t it?

>> The ability to do camelCasing? >> Or is that brand new, yeah?

>> Yes.

>> Okay.

>> The highlighting is new.

>> Right.

>> And the filtering is new.

>> Right, okay.

>> Yes, but the actual camelCasing has always existed.

>> Right.

>> But not a lot of people know about it. So that’s why added the bolding in there, so you can say this actually works and applies to something. Unfortunately, the camelCasing only works if you match the case. So you have to capital G, capital S, you can’t do lowercase g, lowercase s. So those are just some things to help you when you have a lot of information coming at you, to help you filter them down, when you’re exploring and navigating, try to figure out how things work and learn unfamiliar codebases.

>> Cool.

>> So that’s where we’re improving productivity there. And so the next thing that we do is we’ve added a lot of, what we call code actions or quick actions, and we’re factoring to Visual Studio, which each release, we try to add more and more of those. And so the whole point of those is we basically, as we’re writing code all the time, you encounter the same old boilerplate that you have to fill in, or you just wanna extract a method. And it’s so easy just to copy and paste it, but it takes so much effort to move the mouse or to navigate through with the arrows. What if there was one click to do it? And so that’s what we try to do is try to make all these quick little actions that you do down into one click, and so that’s what this light bulb is that you’ll see. So for example, you can see here that there’s already a light bulb here with Quick Actions for things I can do. We’re not gonna get to that yet because as I typed the switch, you can see there’s this little box next to switch on the left, which means it’s a snippet.

Okay, see that?

>> Yes.

>> And that means it’s a code snippet, which means if I click Tab, Tab, it’s gonna automatically put the boilerplate in for me, which this existed in previous versions of Visual Studio, but just wanted to recap it. And so in here, it automatically puts me in here. So I just immediately start typing. So diagnostics, and then also do the different severities of analyzers, code in writing. So now that I’ve typed this whole thing in, if I click Enter again, it’s gonna auto populate my switch-

>> That is so cool.

>> With all my different cases.

>> That is cool.

>> Yeah, which this has existed in former versions. Just people don’t know about it. Yeah.

>> Really?

>> Yeah. [LAUGH] See, people don’t know about it. So yeah, and so it’s these codes snippets that exist that-

>> Well, I knew code snippets existed, but I didn’t know that you got that auto-expansion of all the possible choices.

>> Yeah, so it’s pretty great. There’s also, not a lot of people know about, is click Shift+Alt. You have this box selection where I can select across this whole thing. So if I am missing cases, I lost a, oop, lost a bracket there, so come up here, complete that, and we now, you can see there’s a light bulb that’s appearing over here on the side next to the line numbers. So that means if I click Ctrl+dot, that means there’s something I can do here, a quick action or a factoring, and so you can see here, that’s telling me I’m missing switch cases, and it will offer to add them for me. It also will offer to add me a default switch case, which I’m missing, or the option to add both. And you’ll see a little code preview pop up, that’s basically gonna show you a dif of what we’re going to do for you here. Which is super helpful, cuz you don’t know exactly what’s going to happen, and so you see this code preview. And you’re like, that’s exactly what I want to happen. So here I actually wanna add both.

Then I can click Enter, and it’s gonna add both for me. Another cool thing is like say, I want my error case to be on the top, I can just kind of like select these two lines and then do Alt+up arrow, and it’s gonna move it to the top. And then say I want warning to be the next one. Again, just click Alt+up arrow, and I can just quickly reorder these to the order that I wanted them to be.

>> If you’re amazingly dexterous, you could also highlight them with your finger and drag them Yeah, if you have really good, especially on a little Surface touchpad, select this, drag it up.

>> Or do it on the touch screen with your fingers.

>> I even messed it up, look at that.

>> See, you have to be kind of ambidextrous.

>> On a touch screen. I can’t even do it on, nope, doesn’t even work on touch screen. Yeah, so again, it’s just quick things so your hands never have to touch the mouse. You can do all this stuff with just keyboard shortcuts. So, it’s Alt+Up and Alt+Down. So, if I select my two lines, I don’t even have to select the whole line. I just have to have basically a highlight in it, and then Alt+Down and Alt+Up is gonna move them. Another thing we did is say I want to do something special here if I have an error so-

>> Here’s a question. So let’s say you just moved the case and not the break and now you’ve got a case, break, break. You could get the order mixed up. Is there a keyboard shortcut to look at that?

>> You mean if I do something like that?

>> Yeah, so it would be a pilot error.

>> Is there a lightbulb that would come on and say, I know what’s wrong.

>> No, right now it would just say hey something is totally wrong here.

>> Okay.

>> So you no enclosing loop of which break to continue.

>> Right.

>> Yeah, sorry, we’re not that smart yet. [LAUGH] We’re getting there.

>> Well the simplest of cases, it would be easy to do, but I can see it would pretty quickly get to the point where we don’t necessarily know what you were trying to do,

>> Right.

>> And so it’s kind of hard to make a suggestion.

>> Yes.

>> So if I want to I don’t know, let’s see. Let’s see if there is something I can if on here. So I’ll do my Alt+P, okay, so the document name I don’t know, StartsWith(“D”). Then I wanna return something, return Tasks. We’re just gonna dummy it cuz it doesn’t matter. I guess we can just return. Well a lot of times you wanna do is like, I actually want to do more stuff in here besides just return. Or I guess, I gotta do some break, let’s say I just break here. A lot of times like, shoot there was like something else I wanted to do in here and so we, what we have to do is we come up to this line type in a brace to make it multi line, delete that extra brace it auto puts in, come back down here, close it and now it’s right. So took a lot more effort than I really wanted it to, so what we did instead, is now, once you’re up here, you can do Ctrl+dot, and now it will add our braces for you.

>> Yes.

>> And you don’t have to think about anything.

>> [APPLAUSE]

>> So it just makes everything so much easier, to just be able to add that to quickly make this multi-line. And then whatever I wanted to do in here, I can now do. So I don’t know, whatever. So that makes that way easier, and these are just the nice little things that we’re trying to do with all these different refactorings, and quick actions. So another one that not a lot of people know about is let’s come down here you can see this line has gotten really long.

>> Mm-hm.

>> So what I can do is I can select this expression that is especially long. And I can click Ctrl+dot again you can see that there was a light bulb that appeared as soon as I selected it meaning there was something I could do. And I can see I have multiple options doing here, but the one that I want is I can now introduce a local variable for this. And so again we get the code preview showing that the line I had before won’t exist anymore. And now it’s gonna create the local for me and condense this expression. So once you click Enter, we also as a productivity point are going to drop you in a rename session.

>> Right.

>> So that if you don’t like the variable name we picked for you, you can just change it. So I don’t like it, and so I can just immediately start typing and say it’s a generic expression.

>> Yep.

>> And to commit it, I just click Enter. And so, again, to rename, you can do Ctrl+RR, and it will put you back in there, and it will highlight in the code all the different places.

>> And if you try to rename it something that already exists you’ll get a bunch of red font.

>> Right, so if I try to name it something like this, it will say you have conflicts, and you can see in this top thing up here that I have two unresolvable conflicts. And I do this. I can also choose to include comments or strings when I do my rename.

>> Those two features have been in 2015?

>> Yes, they’re in 2015.

>> Right.

>> All along.

>> And are there new, how much new has been added to the things that the lightbulb will tell you? The suggestions.

>> Right, so, in VS15, the add braces will be in there, the add missing switch case will be in there. So those were some new ones that we threw in.

>> We also add a convert property new method and I think convert method to property is in the other one in 2015 one of the updates. We’re just adding a smattering of them in there. And the hope is we don’t necessarily have to tell you they exist you just as your working will see a lightbulb and then you’ll know to do it.

>> Has the philosophy of when the lightbulb appears versus when you need to Ctrl+dot and call it up, how has that evolved?

>> What do you mean?

>> Well for example, if I have usings that I’m not using, they get a little bit grayed out and a lightbulb appears

>> Right, so the light bulb in that case comes to the forefront. But if I highlight some text or I go to some code that could be refactored but doesn’t need to be. Then sometimes I have to call up the light bulb, right? So, there are kinda times, I don’t know how thin the line is, but you don’t want the light bulb always in your face nagging you, you can do this differently. You can do this differently, verses it never appears and only shows up if you ask it.

>> Right, so that kinda leaves something I’m going to talk about next, where you can see all these vars are squiggled with a green line. And if you hover over it, it says use explicit type instead of var. Which you might be like, whoa, I can use var, that’s It’s totally fine. So what we’re allowing you to do is actually specify what severity level you want some of this code analysis reported at.

>> And you’re using the code analyzer for that, right?

>> Right, so what’s coming in Visual Studio 15 is we’ve basically written a lot of style rules as analyzers. So that if you’re a dev lead on a team, and you realize your team’s spending all this time nitpicking style and formatting and code reviews instead of paying attention to logic. You can now just have an enforced standard on your team that you can share across the whole team for style. Now everyone will just load that and enforce it.

>> Do you still need to, is that built-in on the product or is that something that you download or build yourself?

>> Right, so right now, all these customization of how analyses are reported are baked in. But the goal is to use something like edit or config to allow you to basically abstract out using Nuget and then I can just share that across all the teams and integrate it into your CI and stuff like that.

>> Okay, cool.

>> Yeah, so that’s the goal, hopefully it gets in, we’ll see. [LAUGH] Yeah so just to sneak peek what this could look like is again if I go to the quick launch and I type code style. Then I can just go to code style and I can see here that I have all these different options. So I can choose to prefer this or not prefer this. I can change the severity level. So we have info, warning and error. So error means that your code will not build if you do that and it’ll be a red squiggle. Warning means your code will still build but we’re gonna be really in your face and put a green squiggle in your editor.

>> And is that at the IDE level, the solution level, the project level? And does it roam?

>> Okay, so. [LAUGH]

>> I told you I’d ask questions.

>> Right, so if you have an error. And basically, yes, it’s at the build level. But so if you have an error and you set something as an error, your code will not build.

>> Period, or only for that project?

>> Period.

>> Okay, got it.

>> Yes, well if, assuming that we get the editor config work to release.

>> Then if you say in your editor config that you want, you have your this preferences and they’re errors, they’re all errors. If you use this dot, then your code will not build if you have that editor config.

>> Cuz I could see where you would sometimes want that to be global, but sometimes it’s based on the project.

>> Right, so we’re going to allow you to specify many different editor configs at different levels.

>> Okay, got it.

>> So you would be able to have your basically rule set file at the project level or at the solution level.

>> Right.

>> Or I don’t know.

>> I like to use var, and you might say no, we’re not using var.

>> Right.

>> So when I open the solution that I’m working on with you I would want that rule to be enforced, even at the error level. But when I’m doing my own stuff, I want it to be hidden or none, or whatever, cuz I like var.

>> Yeah, so basically what you should be able to do is you can have a default file that has your default settings. But then, for example, one case is hey, your an Open Source author. Right.

>> And, people are contributing to our code base but they’re using a different style than what you have. But, you want your code base to really be readable, so you want everyone to have the same style. You’ll put editor config, or whatever our file is that we’re gonna have these rules attached to, and then when they download that, and open up in Visual Studio, they’ll get errors and warnings. And things won’t build based off your rules.

>> But it’s still the case that there’s now way of enforcing that. Cuz you could go into Visual Studio and change something that’s an error to just a warning and then type and it’ll compile, right?

>> Right, well you can make it so they can’t check in and edit the new editor config file with their changed setting.

>> Okay.

>> So you can say, we do not accept editor config files. So in their poll request. You can be like no you changed the settings in here. Like no. [LAUGH] Yeah, so as you see in here that I have all my var preferences set to warnings. I say you should use an explicit type and if you don’t it’s a warning. I could change this to an error. We have something called info, which basically means it has no editor presence at all, but it will show up in your error list.

>> Right.

>> Which is actually something that we’re going to change in the future where we’re actually going to give it an editor presence and call it something more along the lines of suggestion. The reason for this is a lot of people don’t know some of these refactorings exist, or code actions and so we are trying to find an unobtrusive way of introducing them to people. And so it’ll be like a faded gray line or something and then from there you’ll just say, I can do something here. Click control dot, and I can see I’ve got braces, or something.

>> And [CROSSTALK] will there be the ability to add rules to this? Sort of in the same way that you add analyzers? Cuz I would imagine that, there’s some commonality in the code you’d have to write.

>> Right, so, yeah, so this is just a beta version of what it’s eventually going to be. But yeah, you’ll be able to, based on what analyzers load in, control all of their settings all from the same spot.

>> Okay, cool.

>> Basically nothing will be baked in, and it will all be like a NuGet of all the rules is one line of thinking for it. We also have the ability to add naming rules.

>> This is already the best version of Visual Studio ever and a no brainer upgrade.

>> [LAUGH] Yeah, so this is still in beta for naming rules. But you could basically say a rule like, I don’t know. Prefer camelCasing, and then you could basically choose what symbols you want it to apply to. You can add new symbol rules if you want, I can choose the naming style. So I can come over here and say I want camel case. And then you can say what severity you want it to be at. So it’s an error.

>> So there’s a required prefix. Can there be prefixes that aren’t allowed? Like if you.

>> Yeah, so you can make all fields have underscore or whatever you want.

>> Or like you don’t want to accept underscores, right? Can you do that? Can you say you can’t name something starting with an underscore?

>> Well, yeah I guess you would do that by saying there’s no required prefix.

>> Okay.

>> So if there is none and then you do it. And that would work. Yeah, we’re still working on this. It’s clearly not done, you can see the bottom was missing there, now it’s there. It’s gone again. [LAUGH] But it’s just, to give you a sneak peak into what’s coming and now we’re thinking about code style with analyzers and how you can enforce all these different rules across your teams to really just focus on the logic. And getting stuff done without having to worry about consistent formatting and all this stuff.

>> Right, yep, cool.

>> And that way it makes it easier to onboard new developers as well because the code base is consistent or readable and that they don’t have to figure out who who did what and what different things mean. So another thing that is helpful to know is that I can actually use the side arrow to get into this little code preview and we see down here I can fix all the occurrences in the document, the project, or the solution. So I’d say, I want to use explicit type everywhere in this document and then I just click Enter and then I get a code preview of it. Click Apply and then voila, it changed all of them. You might’ve also noticed that when I did the inline temporary variable that it gave it the syntax node already instead of giving it var. So I guess I can show that again. If I come here, do Ctrl + dot, I can now inline the temporary variable that I have cuz I only use generic expression once. So I can inline it, and if I come back over here, And choose to introduce the local.

You can see that says syntax node over here because it’s following my style rules I’ve set already, since I’m offering var, it’s on that, but if I had said that I prefer var then it would offer var there. So in this code generation that we do we’re also applying our rules.

>> Cool.

>> So you don’t have to do multiple options to get the same thing, it’s all just lumped together, yeah. Another thing that we have that is coming, I think part of it got in one of the updates for 2015 is basically fuzzy matching for references. So let’s say that I’m typing really fast. And I’m not paying attention and I do this, then we actually will figure out what you meant to say and offer it for you.

>> Nice.

>> So it says I switched the e and the i in WebClient and it figured out what I was missing and offers the fix for me where I need to now use System.net. If I go into Options up here. It’s probably under NuGet actually just should find it. Options, Advanced, I can now also do this to suggest usings for types and reference assemblies. And using for types in NuGet packages. So now, if I do this, I have to wait a while for it to index a little bit. But basically what’s gonna happen now is if I type something that, for example, like jtoken, which is referencing the Newtonsoft library, we will basically figure out, we’ve indexed the top 1,000 or so items in NuGet, and we’ll say that was a common NuGet package, you probably want to install this. And then we’ll offer to install it for you, add the reference, and qualify your type for you. So we’ll see if it’s done that yet. Nope, gotta wait a little bit while it’s indexing. We probably should have a loading bar to show this, but yeah.

Yeah, so the whole point of what we’re trying to do is as you program, you never know what your program is going to return. Computer science, I don’t know if you watch Brett Victor and his thing, it’s one of the only forms of engineering or science where you’re building something and you don’t know what it’s gonna look like until you build and run. So it’s like, it might work. It might not.

>> It should work.

>> And so what we’re trying to do is give you all this ambient feedback in editor, so you can have some sort of idea of the feedback of your program. Which is why we have all these squiggles, and let you hover over things, and stuff like that. So you can try to figure out what things mean, and if this is gonna do what you think it’s gonna do. All right, so hopefully that works by now. Yes, so if I have Jtoken, we can now see I have an option. Where it’s gonna say, find and install the latest version. We can also that I did the classic mistake of forgetting to capitalize things to make it pascal case and so it’s gonna offer to fix that for me too in the code preview. And so if I click that, it’ll install the package for me and resolve everything. And so that saves you so much time because now you don’t have to go to the NuGet console, install package, Noonsoft, and then go from there. It’s just all done. You don’t have to add these in or anything.

>> Awesome.

>> Yeah. All right, another thing that we’ve done is a lot of people us the FX Comp rules, and so we actually took some of the top, most commonly used FX Comp rules and made them into Brozlin analyzers, which are what Aaron 2015. So now, as you’re typing, and if you violate an FX Comp rule, you’ll see immediately, instead of waiting on build.

>> Right.

>> So it’s just another thing, a lot of people use FX Comp rules, so like hey, let’s just try to make these where it makes sense, and to analyzers, and then where possible we actually added fixes as well. So if there’s an easy fix for something you did like you forgot the i serializable attribute we will offer to just add it in for you.

>> Cool.

>> Yeah. All right so that was a lot of ambient feedback we’ve done. A lot of quick actions we’ve added, what else do we want to see? So another thing not a lot of people know about is if I go to the Error List, Oops too many r’s. So basically, a lot of people will open the Error List and start to go through to resolve all their errors so let me actually change my code start rules so I have a bunch of errors. So, I’m going to Code Style, I’m gonna go here, I’m gonna make all of these errors. Type a little bit. So that reruns the analysis. Except I need to change it to prefer var instead. So now if I prefer var, You can see now that all of these turn red. So if I open my error list, a lot of people don’t know is I can actually click F8, and so if I do F8 in Editor it’ll jump me through my file to all my different errors. So we have this cool-

>> That’s been in there a while though, right?

>> Yep, so we have this cool scroll bar that shows you where all the different errors are. And so, a quick way of just navigating to all of them is just F8, F8, F8, F8, so you can go through your whole document and fix all those problems.

>> Cool.

>> And then eventually, when we have, which we name the info to suggestion then you should be able to use F8 to go through your document and find all the different suggestions. So then when you, after you write your whole code, and you got your logic down, and you just wanted to refactor it, you can be able to click F8 and just jump to all the different places where you could do a refactoring. And to help clean up your file.

>> Cool.

>> Yeah, what else can we show? And F8 works as well when you do Find All References and things like that. Another thing the navigation that we added in Visual Studio 2015 update one is the ability to go to implementation. So there’s now the option where you can go to thing’s implementations, which not a lot of people knew about before. We can also peak definition which basically opens up an in-line go-to definition for you.

>> Right.

>> So from here I don’t have to have, basically when I watch people program you just see a bajillion tabs across the top and they just never close their tabs. And then if they see Visual Studio getting slow they’ll close all but this one tab.

>> Right.

>> And start again til they get a bajillion tabs. So that’s what peak definition tries to help solve, is instead of having to open up tabs for all these different GoTo Definitions you can now inline, just quickly see.

>> Right, you can also edit in there, as well.

>> Yeah, you can also edit in here.

>> You could also keep navigating. So if I go definition of that. So this is going to metadata so It might take a while. But I should be able to see. Let’s see. So now if I go to typeSymbol [INAUDIBLE]. This is a bad example, okay? Let’s do root. Go to definition. Peak definition. Peak definition. Yeah, I’ll go peak definition and go peak definition. I’ll just open them all up in here, so you can dive down into the rabbit hole of navigation. But also, we have right here, the ability to go back and forth. So I can navigate to all my different history of navigations.

>> Cool.

>> Which is really helpful, cuz a lot of people when they’re investigating bugs will say what does this mean? Dive into it. What does that mean? Go into it. What does that mean? And they end up going down this whole rabbit hole and they’re like wait, I want to go back to where I just was and where I was before that, and where I was before that. And they get lost a lot of times and so this just keeps it all preserved for you so that you can just easily navigate.

>> Sweet.

>> Yeah that I think is a lot of the stuff that we’ve done. I don’t know, do you want us to use source control stuff? I can show a little bit.

>> Sure.

>> Do I wanna sit through this stuff? Of course.

>> [LAUGH] No, source control stuff. I don’t know.

>> You’re in charge.

>> Yeah, I can just blabber forever about productivity stuff.

>> Where are we at? 44 minutes, all right, just one more thing.

>> Okay, so there’s now this ambient feedback with source control.

>> You said this would take 45 minutes and we’re at 45 minutes, which is unprecedented for this show.

>> [LAUGH]

>> You’re like the first guest who ever actually did 45 minutes of stuff for 45 minutes.

>> Awesome, so you see down here we have ambient feedback on basically our source control so you can see I have a master branch here. I can create a new branch if I want. And I can call it I don’t know, Demo. So now I’ve created a new branch, it’s switched me to that branch so I’ve checked out to that branch. I can see what repo I’m in, I can see that I’ve made changes here. And then when I open up it will take me right to Team Explorer and show me all that stuff. I can add my changes in here, stage them, give commit messages, commit all my staged things. And then I can see up here that I have unpublished commits, and then I can check them out there. And so we’ve basically done a lot of work to improve the Git workflow inside Visual Studio. And again, give you this ambient feedback. So it lets you know, what is the status of your repo, and what branch you’re on. And let you check out. And see the diffs between different commits and stuff like that. And so again we’re just trying to make everything for you more productive.

So you can just get to writing code and make cool stuff.

>> Cool.

>> Yeah.

>> Cool, so you showed a bunch of stuff that is coming in the next version. How much more additional stuff do you think there might be before that ships if you can share that with us?

>> Besides what I’ve shown?

>> Yeah is it close to being done? Is there a whole bunch more being planned?

>> So there’s always more being planned. [LAUGH]

>> Right.

>> Like there’s always so much stuff we want to do. It’s just how are we going to break it down into smaller stories for each release. But as a whole in Visual Studio we’re trying to put more and more features into each updates. So basically every update will offer more and more stuff.

>> Okay.

>> So whatever comes out at RTM, there will be more that builds off of it in update one and however many updates are thereafter.

>> Right, and as always, the best place to comment on this stuff as UserVoice?

>> UserVoice is one place, we also have a GitHub for our team. So if there’s IDE related things with regards to analyzers or errors, or like C# itself, I just go to GitHub.

>> Right, cuz Roslyn’s open source, right?

>> Yes, the compiler, yeah, it’s all open source, yeah.

>> Cool, all right, thanks for coming on the show.

>> Yeah, thanks for having me.

>> Lots of cool stuff.

>> Yup, we’re excited. If anyone has productivity feature requests, just post them on UserVoice, or on our GitHub and we’ll definitely look into them.

>> Excellent, thanks.

>> Yeah, thank you.

>> All right, hope you enjoyed that. We will see you next time on Visual Studio Toolbox.

 

Read the video

In this episode, Robert is joined by Kasey Uhlenhuth, who shows off a number of features that increase your code writing productivity in the current and next versions of Visual Studio. Among the things she shows are the C# Interactive window, Quick Launch, Navigate To, IntellliSense improvements, refactorings and better feedback from the code editor.


Comments to Developer Productivity in VS 2015 and VS 15

  • What’s the point for C# Interactive, we have Powershell already.

    Haitch July 20, 2016 1:14 pm Reply
  • https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#HistoryYou skipped v13 because superstition, I think.

    JohnLudlow July 20, 2016 4:44 pm Reply
  • @Haitch:You can test code snippets in C# interactive without creating a new project.

    MichaelSuen July 20, 2016 7:04 pm Reply
  • where is vb.net interactive window ?

    adi July 20, 2016 7:14 pm Reply
  • by the way VS 2015 was not more productive. it was the slowness only.

    MhAlan July 20, 2016 7:35 pm Reply
  • IntelliSense filtering YAY!!!

    Mike July 21, 2016 2:31 pm Reply
  • Cool stuff and very nice presentation 🙂 Thank you.Please just don’t throw in too many of these productivity enhancements because we might come to the point when it becomes contra-productive. With every new VS version the application is getting slower and slower. Even on the high-end machines (in my case 16GB, 16xcore and SSD) I can notice delays in menu appearance loading of the code files etc.  Recently I had to switch off tons of options in VS (Including new diagnostic tool) to increase the performance. I am even considering using RAM disk but that will be the last option :)I don’t know if this is due to WPF or what but please start thinking how to create a more "lightweight" version of VS. Check what VS tools are most frequently used and make installation such way you disable those features which are not in the "most used" list.Thnx and keep up the good work.

    DarkoL July 23, 2016 4:04 am Reply
  • a lot of the new intelliSense features already exist in Resharper, I wish they would merge

    Meir017 July 23, 2016 12:38 pm Reply
  • Re: C# interactive. Finally an almost complete implementation of a feature that was part of Smalltlak at least 30 years ago!

    flynch July 24, 2016 10:32 am Reply
  • Should we use the Visualstudio Uservoice for Interactive window feature requests?#r, could be improved with an option that ref’s your current open file’s using statements. LINQPad is my tool of choice, it allows you to debug and step through the code. Great for EF and linq too.

    OzBobWa July 24, 2016 10:01 pm Reply
  • OzBobWa July 24, 2016 10:02 pm Reply
  • @DarkoL: in VS ’15’ we are focusing a lot on performance/reliability/install time, with some of the performance improvements available in VS2015 Update 3. If you are working in a large solution, these suggestions may help improve your performance as well.@OzBobWa: Yes, we still look at UserVoice. I would recommend filing an issue on our Roslyn repo as well (that way you can track our progress).

    kaseyu July 27, 2016 9:05 am Reply
  • Who comes up with this garbage? These are NOT 'productivity enhancements', they are another layer of bloat-ware to make an already slooooow Vis Studio even slooowwweerr. If you need a productivity tool to help you with a switch statement, then you should be flipping burgers, not trying to write software. Stop adding all this crap in and just make Vis Studio faster. Have some common sense Microsoft. People don't 'need' to be doing what you think they should be doing.

    Rob August 9, 2016 6:15 am Reply
  • @Haitch: PowerShell is not C#. not the same syntax, not the same API.

    tsahi August 20, 2016 11:27 pm Reply
  • What was the name of the Computer Science person you cited about not knowing your what your output is until you build? It sounded like Bret Richter? But I don't find anything online for that name.

    Erik August 23, 2016 10:15 am Reply
  • I love the enhancements. My only concern is the performance of VS. Mainly the XAML designer. I have to end task on it many times a day. So much so I use the code editor for XAML so the designer doesn't run.

    don September 1, 2016 3:19 pm Reply
  • I think Surround with braces would be much better than Add braces. Most of the time your cursor is already at the statement inside when you realize you want to add some more stuff, so it would be useful if you didn’t have to go back to the if statement and could just control+dot, Surround with braces and hit enter to go to the next line.

    Neme September 22, 2016 12:44 pm Reply
  • //maybe speed up the installation process or let everything to download first then start the install. it looked like downloads a few things then install them, if for some reason the machine goes offline the install process will fail or give an error in the end

    name September 26, 2016 3:48 pm Reply
  • Cool!

    payini October 30, 2016 10:39 pm Reply

Leave a Comment

Your email address will not be published. Required fields are marked *

Loading...
1Code.Blog - Your #1 Code Blog