Watch videos with subtitles in your language, upload your videos, create your own subtitles! Click here to learn more on "how to Dotsub"

Visual Studio 2012 JavaScript Editor

0 (0 Likes / 0 Dislikes)
  • Embed Video

  • Embed normal player Copy to Clipboard
  • Embed a smaller player Copy to Clipboard
  • Advanced Embedding Options
  • Embed Video With Transcription

  • Embed with transcription beside video Copy to Clipboard
  • Embed with transcription below video Copy to Clipboard
  • Embed transcript

  • Embed transcript in:
    Copy to Clipboard
  • Invite a user to Dotsub
[Microsoft] [] [Visual Studio 2012 & One ASP.NET] [Scott Hanselman, Principal Community Architect] [Microsoft Corporation] Hi, this is Scott Hanselman, and I wanted to share a couple of cool features of Visual Studio 2012 and ASP.NET 4.5, specifically in this short video the JavaScript editor. Lots of new stuff in the JavaScript editor. Little improvements that make life easier. One of the things that didn't work very well in previous versions of Visual Studio is that you would get used to features in one language editor, like for example the C# editor, that had collapsing of regions, brace matching, go-to definition support and lots of other little things, and then you'd move into other languages, like CSS, HTML or JavaScript, and wouldn't have that same experience. We've gone through the entire application to make sure that every one is a first-class language. JavaScript, CSS, HTML, Visual Basic, C#, they all have the same great experience. I'm going to go and create a brand-new JavaScript file. I called it test.js. Notice that I've got some existing scripts in my application, and I've got a references file. This _references shows that for any JavaScript file that I create I automatically want to have support for jQuery, jQuery UI and modernizer there so that those references can be automatically resolved, and it assumes that I'm going to have that set up at runtime. Where I'm sitting in test.js, I can automatically open up a jQuery object, and you see I've got IntelliSense, documentation, named parameters, overloads. We've got 5 overloads here. I've got modernizer. I could say if, tab, it's not the case that modernizer.inputtypes.html5 datetime is supported, enter, open up a jQuery object and say if date time isn't supported, then let's take anything that has datetime, grab that dot. Notice that I've got IntelliSense and help, and let's turn that into a date picker. We're going to take anything that is an input type of datetime if datetimes are not supported in this browser, and we'll automatically turn that into a date picker. Notice that I had IntelliSense at every step of the way. Well, it's actually more than that. Let's make a new function here. We'll call it foo, and I'll say x, y, and z. I'll come down later and pretend that I'm calling foo. Notice that foo has already shown up in the IntelliSense. I open it up. X, y, and z are there. Let me change the parameter list right back. Notice that IntelliSense is automatically updated. I didn't have to rebuild anything. I didn't even save the file. In this case, IntelliSense is not only happening automatically, but the entire JavaScript file is being run constantly. Additionally, we could add some hints to this. I could go into my function foo here, and we could put in a little bit of XML documentation about these types. In this case, I'll say that the parameter x is an int, because it's special. I'll say close param, and I'll come right back down here, and when I do my IntelliSense on foo, notice that I've got extra information about x. I could have that inline in my JavaScript, or I could have that in a separate VS documentation file. If I had my test.js, I could have test.vs.js. We've got those automatically for jQuery in all the big libraries. I could say var a = 1, type in a., and notice that I'm getting IntelliSense like toExponential and toFixed. These are all number specific things, because the editor knows that this is a number. If I change a to a string, type in a., notice that I'm getting things like characterAt and length and replace as well as ECMAScript5 standard functions like trim, because it knows that a is a string in this case. It actually ran the JavaScript, and that's how we're able to have such great IntelliSense. Visual Studio editor now handles outlining. You get brace matching, collapsing of methods. You have right click, go to definition. I'll say right click, go to definition on date picker and know that it automatically opens up jQuery UI. We've also got validation and color coding for regular expressions. JavaScript editing in Visual Studio 2012 is a lot more fun than it used to be. It's a much more active and updated environment that gives you not only IntelliSense, completion hands-on function signatures, autoreducing statement lists, document.all and lots, lots more. We hope you enjoy using it as much as we had fun writing it. [Microsoft] []

Video Details

Duration: 5 minutes and 4 seconds
Country: United States
Language: English
License: All rights reserved
Genre: None
Views: 5
Posted by: neudesicasp on Oct 3, 2013

Visual Studio 2012 JavaScript Editor

Caption and Translate

    Sign In/Register for Dotsub to translate this video.