{"id":225231,"date":"2016-11-28T14:32:09","date_gmt":"2016-11-28T22:32:09","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=225231"},"modified":"2019-05-03T15:08:14","modified_gmt":"2019-05-03T22:08:14","slug":"more-productive-javascript-in-visual-studio-2017-rc","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/more-productive-javascript-in-visual-studio-2017-rc\/","title":{"rendered":"More Productive JavaScript in Visual Studio 2017 RC"},"content":{"rendered":"<p>We know you choose Visual Studio for JavaScript editing because it provides tools that make you the most productive. In Visual Studio 2017 RC, we\u2019ve been focusing on improving the things you use most so that you can spend even more time focusing on coding. In this post, we will highlight some of the most exciting improvements to IntelliSense and code navigation that are available today in <a href=\"https:\/\/www.visualstudio.com\/vs\/visual-studio-2017-rc\/\">Visual Studio 2017 RC<\/a>.<\/p>\n<h2>Richer IntelliSense<\/h2>\n<p>JavaScript IntelliSense in Visual Studio 2017 RC will now display much more useful information on parameter and member lists. This additional information is provided by <a href=\"http:\/\/typescriptlang.com\">TypeScript<\/a>, which uses static analysis behind the scenes to better understand your code. TypeScript uses several sources to build up this information.<\/p>\n<p><b><i>Rich IntelliSense on jQuery ajax() function<\/i><\/b><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/Rich-IntelliSense-on-JQuery-ajax-function.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/Rich-IntelliSense-on-JQuery-ajax-function.png\" width=\"750\" height=\"334\" \/><\/a><\/p>\n<h3>IntelliSense based on JSDoc<\/h3>\n<p>When the default type inference does not provide the desired type information, type information may be provided explicitly via JSDoc annotations. For example, to give a partially declared object a specific type, you can use the <code>@type<\/code> tag as shown below:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/IntelliSense-based-on-JSDoc.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/IntelliSense-based-on-JSDoc.png\" width=\"550\" height=\"321\" \/><\/a><\/p>\n<p>This is also very useful for specifying parameter information. Using the JSDoc <code>@param<\/code> tag you can add types to function parameters like so:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/Using-the-JSDoc-@param-tag.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/Using-the-JSDoc-@param-tag.png\" width=\"850\" height=\"220\" \/><\/a><\/p>\n<p>See <a href=\"https:\/\/github.com\/Microsoft\/TypeScript\/wiki\/JsDoc-support-in-JavaScript\">this doc on github<\/a> for the JSDoc annotations currently supported.<\/p>\n<h5><\/h5>\n<h3>IntelliSense based on TypeScript Declaration Files<\/h3>\n<p>In the TypeScript world, most popular JavaScript libraries have their APIs described by <code>.d.ts<\/code> files, and the most common repository for such definitions is on <a href=\"https:\/\/github.com\/DefinitelyTyped\/DefinitelyTyped\">DefinitelyTyped<\/a>. Behind the scenes, Visual Studio will use these <code>.d.ts<\/code> files to enrich your IntelliSense.\nVisual Studio will detect which JavaScript libraries are in use and automatically download and reference the corresponding <code>.d.ts<\/code> files. These files are downloaded to a cache located under the user folder at <code>%LOCALAPPDATA%\\Microsoft\\TypeScript<\/code>. (Note: This feature is <strong>disabled<\/strong> by default if using a <code>tsconfig.json<\/code> configuration file<\/p>\n<p>Currently auto-detection works for dependencies downloaded from npm (via reading the <code>package.json<\/code> file), Bower (via reading the <code>bower.json<\/code> file), or loose files in your project that match a list of roughly the top 400 most popular JavaScript libraries. For example, if you have <code>jquery-1.10.min.js<\/code> in your project, the file <code>jquery.d.ts<\/code> will be fetched and loaded. This <code>.d.ts<\/code> file will have no impact on your project other than providing better completions, signatures, and contextual help.<\/p>\n<h2>ES6 and JSX Syntax Support<\/h2>\n<p>The JavaScript language is constantly evolving and Visual Studio will now help you keep up with language changes by supporting syntax updates much faster. Every year TC39, the ECMAScript standards body, releases official updates to the language. These updates bring new syntax such as classes, arrow functions, and template strings, that provide alternative, more productive ways to write JavaScript. In Visual Studio 2017, syntax through ES7 (<a href=\"https:\/\/tc39.github.io\/ecma262\/\">ECMAScript 2016<\/a>) including modules, classes, and arrow functions are fully supported.<i><\/i><\/p>\n<p><b><i>ES6 syntax in Visual Studio 2017 RC<\/i><\/b><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/ES6-syntax-in-Visual-Studio-2017-RC.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/ES6-syntax-in-Visual-Studio-2017-RC.png\" width=\"750\" height=\"279\" \/><\/a><\/p>\n<p>In addition to official language updates, there are also unofficial language extensions like <a href=\"https:\/\/facebook.github.io\/jsx\/\">JSX<\/a>, an XML-like extension that is popular in React development, that call for more flexible syntax support. Visual Studio 2017 supports both jsx and tsx file extensions as well as JSX syntax dropped directly in JS and TS files.<\/p>\n<p><b><i>JSX syntax in Visual Studio 2017 RC<\/i><\/b><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/JSX-syntax-in-Visual-Studio-2017-RC.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/JSX-syntax-in-Visual-Studio-2017-RC.png\" width=\"750\" height=\"391\" \/><\/a><\/p>\n<h2>General Improvements<\/h2>\n<p>In addition to language specific improvements, you will also benefit from several general code navigation improvements. Go To, a completely new navigation feature, allows you to quickly perform complete searches to find types, functions, files, and more. Results can be filtered down based on category, to provide a single location for fast code navigation.<\/p>\n<p><b><i>Navigation with Go To (ctrl + t or ctrl + ,)<\/i><\/b><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/Navigation-with-Go-To-ctrl-t-or-ctrl-.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/Navigation-with-Go-To-ctrl-t-or-ctrl-.png\" width=\"750\" height=\"406\" \/><\/a><\/p>\n<p>When working with large projects or libraries, often the number of results in completion lists can get quite large. To help you quickly cut down the size of these lists, you can now filter the completion lists by categories such as functions and properties. All of these filters can be quickly toggled with logical hotkeys, which can be easily discovered by hovering over the filter button icons in IntelliSense.<\/p>\n<p><b><i>IntelliSense filtering on functions (alt + m)<\/i><\/b><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/Navigation-with-Go-To-ctrl-t-or-ctrl-.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/05\/Navigation-with-Go-To-ctrl-t-or-ctrl-.png\" width=\"750\" height=\"386\" \/><\/a><\/p>\n<p>To read more about the above improvements and get an overview of all the general productivity improvements coming in Visual Studio 2017, check out this post by Mark Wilson-Thomas on <a href=\"https:\/\/blogs.msdn.microsoft.com\/visualstudio\/2016\/11\/28\/productivity-in-visual-studio-2017-rc\/\">Productivity Improvements in VS 2017 RC<\/a>.<\/p>\n<h2>Send Feedback<\/h2>\n<p>We hope you\u2019re excited to take your JavaScript development productivity to a new level in <a href=\"https:\/\/www.visualstudio.com\/vs\/visual-studio-2017-rc\/\">Visual Studio 2017 RC<\/a>. Check out <a href=\"https:\/\/channel9.msdn.com\/Events\/Connect\/2016\/141\">this quick video<\/a> to see some of the above features in more detail, but we encourage you to download it yourself and give it a spin. Feel free to log any problems using the <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio-2017\">Report a Problem<\/a> tool in the upper right corner of the IDE or the installer. You can also submit any suggestions through <a href=\"https:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio-ide\/category\/31477-languages-javascript\">UserVoice<\/a>.<\/p>\n<p>Happy hacking!<\/p>\n<table border=\"0\" width=\"600\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"150\"><img decoding=\"async\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/04\/Bowden-Kelly.jpg\" width=\"187\" height=\"186\" \/><\/td>\n<td valign=\"top\" width=\"450\"><strong>Bowden Kelly<\/strong>, Program Manager, VS Client\n<a href=\"https:\/\/twitter.com\/bowdenk7\">@bowdenk7<\/a><\/p>\n<p>Bowden works on the JavaScript editing experience with a focus on helping developers be more productive in Visual Studio. Outside of work he enjoys playing soccer, teaching the basics of programming, and attempting to be a triathlete.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>We know you choose Visual Studio for JavaScript editing because it provides tools that make you the most productive. In Visual Studio 2017 RC, we\u2019ve been focusing on improving the things you use most so that you can spend even more time focusing on coding. In this post, we will highlight some of the most [&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":[155],"tags":[124,526,156],"class_list":["post-225231","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-javascript","tag-productivity","tag-visual-studio-2017"],"acf":[],"blog_post_summary":"<p>We know you choose Visual Studio for JavaScript editing because it provides tools that make you the most productive. In Visual Studio 2017 RC, we\u2019ve been focusing on improving the things you use most so that you can spend even more time focusing on coding. In this post, we will highlight some of the most [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/225231","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=225231"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/225231\/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=225231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=225231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=225231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}