{"id":5154,"date":"2007-03-01T21:25:00","date_gmt":"2007-03-01T21:25:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/2007\/03\/01\/jscript-intellisense-in-visual-studio-orcas\/"},"modified":"2007-03-01T21:25:00","modified_gmt":"2007-03-01T21:25:00","slug":"jscript-intellisense-in-visual-studio-orcas","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/jscript-intellisense-in-visual-studio-orcas\/","title":{"rendered":"JScript IntelliSense in Visual Studio Orcas"},"content":{"rendered":"<p><P>The <A class=\"\" href=\"http:\/\/www.microsoft.com\/downloads\/details.aspx?FamilyID=b533619a-0008-4dd6-9ed1-47d482683c78&amp;DisplayLang=en\">March CTP<\/A> of Visual Studio marks the debut of a much-requested and long-awaited feature: improved JScript <A class=\"\" href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/hcw1s69b(VS.80).aspx\">IntelliSense<\/A>.&nbsp; We\u2019ve been working on this for almost a year now and I\u2019m pretty excited to finally be able to share it with the public.&nbsp; There are a variety of topics I\u2019d like to deep dive into, but for today let\u2019s just take a quick aerial tour of the new features.<\/P>\n<P><STRONG>1. Proactive Completion List<\/STRONG><\/P>\n<P>Our old list was a bit lazy and only \u201cawoke\u201d when you typed a period while accessing a member.&nbsp; Our new one is on-its-toes and is wired up to the language grammar.&nbsp; Net effect: it comes up when you would expect it, and you can spend less time pressing ctrl+J. =)<\/P>\n<P><STRONG>2. Keywords in Completion List<\/STRONG><\/P>\n<P>In practice, you will spend half of your time typing keywords.&nbsp; Now they\u2019re part of the list.<\/P>\n<P><IMG border=\"1\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/Image2.png\"><\/P>\n<P><STRONG>3. ASP.NET AJAX Concepts in Completion List<\/STRONG><\/P>\n<P>We have new glyphs corresponding to objects and functions that have registered themselves as ASP.NET AJAX Namespaces, Classes, Interfaces, Properties, Enumerations, etc.&nbsp; Since lists are usually long, this is particularly useful for quickly discovering that particular member you\u2019re looking for.<\/P>\n<P><IMG border=\"1\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/Image3.png\" width=\"600\" height=\"250\"><\/P>\n<P>The glyphs are aligned with the ones you would see in managed programming.&nbsp; Vanilla fields and functions are now just marked as blue and magenta boxes respectively.<\/P>\n<P><STRONG>4. IntelliSense from Script Libraries for ASPX Pages<\/STRONG><\/P>\n<P>The cornerstone feature is the new ability to see objects and functions declared in external script files.&nbsp; Note below that $addHandler was not defined in the current document:<\/P>\n<P><IMG border=\"1\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/Image4.png\" width=\"600\" height=\"250\"><\/P>\n<P>How do we know which files you\u2019re referencing?&nbsp; We look for Script Managers (and Proxies), and infer what scripts it will bring into the page:<\/P>\n<P><IMG border=\"1\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/Image4a.png\" width=\"600\" height=\"100\"><\/P>\n<P>We look for the normal HTML script reference tags:<\/P>\n<P><IMG border=\"1\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/Image4b.png\" width=\"600\" height=\"20\"><\/P>\n<P>We also take into account any Master Pages that may contain any of the above.<\/P>\n<P><STRONG>5. IntelliSense from Script Libraries for JS Files<\/STRONG><\/P>\n<P>The example above works great for pages, but what if you\u2019re in a JS file?&nbsp; Since there\u2019s no standard syntax, we decided on the following XML comment syntax (which you\u2019ll see a parallelism in the next section):<\/P>\n<P><IMG border=\"1\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/Image5a.png\" width=\"600\" height=\"20\"><\/P>\n<P>The above declaration simply states that the current JS file should display IntelliSense including objects and functions declared in JScript1.js.&nbsp; The following declaration references a script library embedded within an assembly (note the subtle usage of \u201cname\u201d instead of \u201cpath\u201d):<\/P>\n<P><IMG border=\"1\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/Image5b.png\" width=\"600\" height=\"20\"><\/P>\n<P>If the \u201cassembly\u201d attribute is left out, we assume it to be the System.Web.Extensions assembly.&nbsp; This keeps standard references to ASP.NET AJAX scripts succinct.<\/P>\n<P><IMG border=\"1\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/Image5.png\" width=\"600\" height=\"20\"><\/P>\n<P>It\u2019s worthwhile to remember that these declarations must be found at the top of the page before any script or any regular comments.&nbsp; Additionally, these declarations are not used during the runtime in any way\u2014they are for the editor only.<\/P>\n<P><STRONG>6. Enhanced Function and Parameter Tips<\/STRONG><\/P>\n<P>Function and parameter tips now have the ability to show ASP.NET AJAX type information as well as summaries.&nbsp; This should help minimize context-switching when looking for documentation.&nbsp; Tips appear both from the completion list:<\/P>\n<P><IMG border=\"1\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/Image6a.png\" width=\"600\" height=\"50\"><\/P>\n<P>\u2026and underneath the function as you\u2019re typing:<\/P>\n<P><IMG border=\"1\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/Image6b.png\" width=\"600\" height=\"100\"><\/P>\n<P>Where is this information coming from?&nbsp; The editor simply reads the XML comments from the source code:<\/P>\n<P><IMG border=\"1\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/16\/2019\/02\/Image6.png\" width=\"600\" height=\"200\"><\/P>\n<P>ASP.NET AJAX employs a XML documentation comment scheme akin to the <A class=\"\" href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/b2s063f7.aspx\">.NET XML Documentation Comments<\/A>.&nbsp; As long as your sources are commented, we leverage them to display the additional information.&nbsp; ASP.NET AJAX scripts and AJAX Control Toolkit scripts come in commented flavors.&nbsp; For older files that don\u2019t have these comments, we will still show at least the function name and parameter names.<\/P>\n<P><STRONG>7. Type Inferencing<\/STRONG><\/P>\n<P>A foundational feature enabling much of the IntelliSense is our ability to infer types across assignments between JScript variables\u2014which are inherently type-less.&nbsp; The JScript Team, our partner team, has a great <A class=\"\" href=\"http:\/\/blogs.msdn.com\/jscript\/archive\/2007\/02\/10\/jscript-authoring-support-in-orcas.aspx\">post<\/A>&nbsp;on this topic.&nbsp; I\u2019ll defer the discussion of this feature to them.<\/P>\n<P><STRONG>Summary<\/STRONG><\/P>\n<P>JScript IntelliSense is a (purposefully) subtle set of features.&nbsp; I hope this introduction spotlights some of the functionality you might otherwise have missed and gets you up and running.&nbsp; I\u2019ll blog in more depth later.&nbsp; For now, have fun playing with the March CTP and let us know what you think!<\/P>\n<P><STRONG>Jeff King<\/STRONG><BR>Program Manager<BR>Visual Studio Web Tools<\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The March CTP of Visual Studio marks the debut of a much-requested and long-awaited feature: improved JScript IntelliSense.&nbsp; We\u2019ve been working on this for almost a year now and I\u2019m pretty excited to finally be able to share it with the public.&nbsp; There are a variety of topics I\u2019d like to deep dive into, but [&hellip;]<\/p>\n","protected":false},"author":404,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[4,31,7276,7277,7274,7273,7272,147,7267,7268,7269],"class_list":["post-5154","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","tag-net","tag-asp-net","tag-intellisense","tag-jeff-king","tag-jscript","tag-orcas","tag-tips-and-tricks","tag-visual-studio","tag-vwd","tag-web","tag-web-2-0"],"acf":[],"blog_post_summary":"<p>The March CTP of Visual Studio marks the debut of a much-requested and long-awaited feature: improved JScript IntelliSense.&nbsp; We\u2019ve been working on this for almost a year now and I\u2019m pretty excited to finally be able to share it with the public.&nbsp; There are a variety of topics I\u2019d like to deep dive into, but [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/5154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/404"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=5154"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/5154\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=5154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=5154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=5154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}