{"id":863,"date":"2013-07-16T08:00:00","date_gmt":"2013-07-16T08:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudio\/2013\/07\/16\/javascript-editor-improvements-in-visual-studio-2013-preview\/"},"modified":"2022-10-06T11:13:22","modified_gmt":"2022-10-06T18:13:22","slug":"javascript-editor-improvements-in-visual-studio-2013-preview","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/javascript-editor-improvements-in-visual-studio-2013-preview\/","title":{"rendered":"JavaScript Editor Improvements in Visual Studio 2013 Preview"},"content":{"rendered":"<p>[Updated 10\/18\/2013]<\/p>\n<p>The JavaScript navigation was removed from the final release of Visual Studio 2013. The decision to do this was difficult and driven by a need to optimize stability and performance after we received feedback from many of you working with the Preview and RC versions of this feature. We also heard some great feedback about the usefulness of the navigation bar and understand that many of you were looking forward to this coming in the final product. We will be considering a return of the navigation bar for a future release.<\/p>\n<p>[end]<\/p>\n<p>In Visual Studio 2012, we added <a href=\"http:\/\/msdn.microsoft.com\/en-US\/library\/vstudio\/bb386063.aspx#BKMK_CodeEditorJS\">many new features<\/a> for JavaScript developers, delivering a first class JavaScript experience in Visual Studio. Now, in Visual Studio 2013, we\u2019ve continued evolving and improving the JavaScript development experience with a focus on helping you navigate and understand the increasingly complex JavaScript source you\u2019re working on. In this post, I\u2019ll describe two editor improvements that help: <strong>identifier highlighting<\/strong> and the <strong>navigation bar<\/strong>.<\/p>\n<h2>Identifier Highlighting<\/h2>\n<p>When using Visual Studio 2013, you\u2019ll notice that when you select an identifier, like a variable name or function call, references to it are highlighted in the current source file:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/3443.clip_image002_thumb_4AE2AF03.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-233713\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/3443.clip_image002_thumb_4AE2AF03.jpg\" alt=\"Image 3443 clip image002 thumb 4AE2AF03\" width=\"388\" height=\"92\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/3443.clip_image002_thumb_4AE2AF03.jpg 388w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/3443.clip_image002_thumb_4AE2AF03-300x71.jpg 300w\" sizes=\"(max-width: 388px) 100vw, 388px\" \/><\/a><\/p>\n<p>More than a text match, this is a smart highlight that understands the JavaScript language and helps you get a feel for how your code will actually flow when your source is executed. For example, if we extend the above sample with a call to another function after save, you can see that references to rating in the second function are highlighted, but not in the first:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/7367.clip_image004_thumb_09D42F9F.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-233712\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/7367.clip_image004_thumb_09D42F9F.jpg\" alt=\"Image 7367 clip image004 thumb 09D42F9F\" width=\"600\" height=\"133\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/7367.clip_image004_thumb_09D42F9F.jpg 600w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/7367.clip_image004_thumb_09D42F9F-300x67.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h2>Navigation Bar<\/h2>\n<p>The navigation bar in Visual Studio provides an easy and quick way to navigate around your code and the structure of your files. For JavaScript, we\u2019ve tailored the navigation bar experience to the unique scenarios enabled by the language. The navigation bar surfaces the major structural elements of your source no matter how you write your source.<\/p>\n<p>If you are working with loose functions in a script file, the navigation bar will help you navigate through them using the &lt;global&gt; container (located in the left-most drop down, which we call the containers list). As an example, take the following code:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/4075.clip_image006_thumb_44BB6268.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-233711\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/4075.clip_image006_thumb_44BB6268.jpg\" alt=\"Image 4075 clip image006 thumb 44BB6268\" width=\"440\" height=\"184\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/4075.clip_image006_thumb_44BB6268.jpg 440w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/4075.clip_image006_thumb_44BB6268-300x125.jpg 300w\" sizes=\"(max-width: 440px) 100vw, 440px\" \/><\/a><\/p>\n<p>Or, let\u2019s say you are working in a more class-based code base. In JavaScript, keywords like class and namespace aren\u2019t available to define the structure of classes and namespaces in your files. Typically you\u2019ll use a library like WinJS with helper functions to mimic a class-based language. Notice in the following screen shot that the navigation bar understands WinJS namespaces and classes.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/0602.clip_image008_thumb_7CF9D980.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-233710\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/0602.clip_image008_thumb_7CF9D980.jpg\" alt=\"Image 0602 clip image008 thumb 7CF9D980\" width=\"616\" height=\"215\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/0602.clip_image008_thumb_7CF9D980.jpg 616w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/0602.clip_image008_thumb_7CF9D980-300x105.jpg 300w\" sizes=\"(max-width: 616px) 100vw, 616px\" \/><\/a><\/p>\n<p>Regardless of the approach you take, the navigation bar aims to surface the major structural elements of a source file to help you easily browse and work with the contents of your file.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/6661.clip_image010_thumb_2E191421.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-233709\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/6661.clip_image010_thumb_2E191421.jpg\" alt=\"Image 6661 clip image010 thumb 2E191421\" width=\"616\" height=\"201\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/6661.clip_image010_thumb_2E191421.jpg 616w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/6661.clip_image010_thumb_2E191421-300x98.jpg 300w\" sizes=\"(max-width: 616px) 100vw, 616px\" \/><\/a><\/p>\n<h2>Other improvements to the JavaScript Editor<\/h2>\n<p>In addition to the improvements highlighted here, the JavaScript editor provides support for other new Visual Studio editor features:<\/p>\n<ul>\n<li><strong>Brace completion<\/strong> &#8211; In JavaScript, the editor will auto-insert closing characters for: {, (, [, &#8216;, and &#8220;<\/li>\n<li><strong>Move line up\/down<\/strong> (Alt + Up Arrow, Alt + Down Arrow)<\/li>\n<li><strong>Scrollbar enhancements<\/strong><\/li>\n<\/ul>\n<p>To learn more about these, take a look at the <a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/visual-studio-2013-new-editor-features\/\">Visual Studio 2013 Editor Improvements blog post<\/a>.<\/p>\n<p>As you work with these new features in the Visual Studio 2013 Preview release, please let us know what you think by sending us a smile or frown using the new Visual Studio send-a-smile feature!<\/p>\n<table style=\"width: 611px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"111\"><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/1234.clip_image012_46A8B171.jpg\"><img decoding=\"async\" class=\"alignleft size-full wp-image-233708\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/1234.clip_image012_46A8B171.jpg\" alt=\"Image 1234 clip image012 46A8B171\" width=\"96\" height=\"96\" \/><\/a><\/td>\n<td valign=\"top\" width=\"498\"><strong>Jordan Matthiesen<\/strong> (<a href=\"http:\/\/www.twitter.com\/JMatthiesen\">@JMatthiesen<\/a>)\u2013 Program Manager, Visual Studio JavaScript tools team<\/p>\n<p><strong>Short Bio:<\/strong> Jordan is a veteran web developer of 14 years, now working on the Visual Studio team to provide great tooling experiences to JavaScript developers<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>[Updated 10\/18\/2013] The JavaScript navigation was removed from the final release of Visual Studio 2013. The decision to do this was difficult and driven by a need to optimize stability and performance after we received feedback from many of you working with the Preview and RC versions of this feature. We also heard some great [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":255385,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4980,155],"tags":[376,124,126],"class_list":["post-863","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-visual-studio","tag-java","tag-javascript","tag-visual-studio-2013"],"acf":[],"blog_post_summary":"<p>[Updated 10\/18\/2013] The JavaScript navigation was removed from the final release of Visual Studio 2013. The decision to do this was difficult and driven by a need to optimize stability and performance after we received feedback from many of you working with the Preview and RC versions of this feature. We also heard some great [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=863"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/863\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/255385"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}