{"id":4333,"date":"2009-07-13T14:09:00","date_gmt":"2009-07-13T14:09:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2009\/07\/13\/intellisense-and-browsing-with-c0x\/"},"modified":"2019-02-18T18:45:50","modified_gmt":"2019-02-18T18:45:50","slug":"intellisense-and-browsing-with-c0x","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/intellisense-and-browsing-with-c0x\/","title":{"rendered":"Intellisense and Browsing with C++0x"},"content":{"rendered":"<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Hello Everyone, <\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">My name is Sunny Gupta and I am a SDET on VC++ IDE &amp; Compiler team. In this blog I will be talking about the IDE support for Cpp0x.<\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">What is C++0x??<\/font><\/p>\n<p class=\"MsoNoSpacing\"><font face=\"Calibri\" size=\"3\">C++0x is the name <span>for the<\/span> next version of the C++ Programming Language Standard.&nbsp; For VC 10, the C++ 0x features that have been implemented in the compiler so far are &ldquo;auto&rdquo;, &ldquo;lambdas&rdquo;, &ldquo;rvalue references&rdquo;, &ldquo;decltype&rdquo;, &ldquo;nullptr&rdquo; and &ldquo;static_assert&rdquo;.<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Details about these can be read from:<\/font><\/p>\n<p class=\"MsoListParagraph\"><font color=\"#0000ff\"><span class=\"MsoHyperlink\"><span><span><font size=\"3\">&middot;<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<\/span><\/span><\/span><\/span><span><a href=\"http:\/\/blogs.msdn.com\/vcblog\/archive\/2008\/10\/28\/lambdas-auto-and-static-assert-c-0x-features-in-vc10-part-1.aspx\"><font size=\"3\"><font face=\"Calibri\">Lambda-auto-static_assert<\/p>\n<p><\/font><\/font><\/a><\/span><\/font><\/p>\n<p class=\"MsoListParagraph\"><font color=\"#0000ff\"><span class=\"MsoHyperlink\"><span><span><font size=\"3\">&middot;<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><\/span><span><a href=\"http:\/\/blogs.msdn.com\/vcblog\/archive\/2009\/02\/03\/rvalue-references-c-0x-features-in-vc10-part-2.aspx\"><font size=\"3\"><font face=\"Calibri\">Rvalue-reference<\/p>\n<p><\/font><\/font><\/a><\/span><\/font><\/p>\n<p class=\"MsoListParagraph\"><span class=\"MsoHyperlink\"><span><span><font color=\"#0000ff\"><font size=\"3\">&middot;<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/font><\/span><\/span><\/span><span><a href=\"http:\/\/blogs.msdn.com\/vcblog\/archive\/2009\/04\/22\/decltype-c-0x-features-in-vc10-part-3.aspx\"><font size=\"3\"><font face=\"Calibri\">Decltype<\/p>\n<p><\/font><\/font><\/a><\/span><\/p>\n<p class=\"MsoListParagraph\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">It will be super cool if the IDE could provide Intellisense and Browsing for all these new features, is VS team going to do that? <\/font><\/p>\n<p class=\"MsoListParagraph\"><span><span><font face=\"Calibri\" size=\"3\">&#8211;<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">Yes, Beta2 is going to have all the intellisense and browsing functionality for these c++ language changes.<\/font><\/p>\n<p class=\"MsoNormal\"><b><\/p>\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><\/b><\/p>\n<h2><span><font size=\"4\"><font color=\"#4f81bd\"><font face=\"Cambria\">Brief Overview of what to expect.<\/p>\n<p><\/font><\/font><\/font><\/span><\/h2>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Before I explain the details of feature I would like to list the cool things.<\/font><\/p>\n<p class=\"MsoListParagraph\"><span><span><font size=\"3\">&middot;<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">A static_assert getting squiggled (red wavy underline under the word indicating some error) with the assert message as the error message.<\/font><\/p>\n<p class=\"MsoListParagraph\"><span><span><font size=\"3\">&middot;<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">Getting parameter help(tool tip about the parameter of the lambda) on lambdas<\/font><\/p>\n<p class=\"MsoListParagraph\"><span><span><font size=\"3\">&middot;<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">Quick info(tool tip that pops up on mouse hove) showing the actual type of an object that is declared using auto<\/font><\/p>\n<p class=\"MsoListParagraph\"><span><span><font size=\"3\">&middot;<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">Complete intellisense for rvalue references as lvalue reference.<\/font><\/p>\n<p class=\"MsoListParagraph\"><span><span><font size=\"3\">&middot;<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">Quick info, Auto Complete etc ., working inside the decltype statement.<\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<h2><span><font size=\"4\"><font color=\"#4f81bd\"><font face=\"Cambria\">Outline of the Feature<\/p>\n<p><\/font><\/font><\/font><\/span><\/h2>\n<h2><span><font face=\"Cambria\">The feature can be better explained with the help of some screenshots: I will be demonstrating just few of the many intellisense\/browsing options available.<\/font><\/span><\/h2>\n<h2><span><font face=\"Cambria\"><img decoding=\"async\" src=\"http:\/\/blogs.msdn.com\/photos\/vcb\nlog\/images\/9832043\/original.aspx\"><\/font><\/span><\/h2>\n<h2><span><font face=\"Cambria\"><\/p>\n<p>&nbsp;<\/p>\n<p><\/font><\/span><\/h2>\n<h2><span><font face=\"Cambria\"><\/p>\n<p><h2><span><font size=\"4\"><font color=\"#4f81bd\">Design and Development of the feature<\/p>\n<p><\/font><\/font><\/span><\/h2>\n<p class=\"MsoNormal\"><font face=\"Calibri\">We had one main goal while designing this feature. That goal was intellinsense parity for cpp0x with all the other cpp constructs. We had the following things in mind during designing the feature:<\/font><\/p>\n<p class=\"MsoListParagraph\"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\">Writing and using lambda should be as easy as writing and using a regular C++ function.<\/font><\/p>\n<p class=\"MsoListParagraph\"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\">Intellisense on an object declared using &lsquo;auto&rsquo; or &lsquo;decltype&rsquo; should be the same if the object was declared using the actual type name<b><\/p>\n<p><\/b><\/font><\/p>\n<p class=\"MsoListParagraph\"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\">Writing a static assert should be as easy as making a function call to some inbuilt function.<\/font><\/p>\n<p class=\"MsoListParagraph\"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\">Intellisense for rvalue reference should behave the same was as it used to behave for an lvalue reference<\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\">Development involved integration of the new cpp0x features with the current intellisense engine. The challenging part was ensuring the IDE shows the expected intellisense and browses to the correct location. Example: Ensuring that on the IDE a lambda is represented as a function with return type and arguments. Lambdas are actually classes with overloaded operator (). So a lambda statement internally creates a class with overloaded operator (). During development just integrating the cpp0x with the intellisense engine would results into lambda being represented as &lsquo;operator ()&rsquo; in the tooltips. Instead of lambda name. We had to makes sure where ever the lambda will be shows, class view, Quick info, Call Hierarchy etc., it should not be displayed as &lsquo;operator()&rsquo; and a proper readable signature should be shown.<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\"><\/font>&nbsp;<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\"><img decoding=\"async\" src=\"http:\/\/blogs.msdn.com\/photos\/vcblog\/images\/9832046\/original.aspx\"><\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\"><\/font>&nbsp;<\/p>\n<p><font face=\"Calibri\"><\/p>\n<h2><span><font size=\"4\"><font color=\"#4f81bd\"><font face=\"Cambria\">Testing<\/p>\n<p><\/font><\/font><\/font><\/span><\/h2>\n<p class=\"MsoNormal\">I was the QA for the feature. Since this was not an isolated feature, the challenging part was to ensure complete intellinsense and browsing functionality inside the IDE for these new c++ language features. Dedicated testing was needed for browsing (Quick Symbol Search, Class View, Navbar, Gotodef etc.) and intellisense (Quick Info, Auto Complete, parameter help and squiggles). This feature is an IDE feature so equal importance was given to IDE testing along with the engine level testing. <span>&nbsp;<\/span><\/p>\n<p class=\"MsoNormal\">Example of an IDE tests is: Ensuring that on mouse hover over a static assert squiggle shows the correct error message tool tip.<\/p>\n<p class=\"MsoNormal\">Example of an Engine level test: ensuring that the Intellisense compiler API returns correct intellisense results. These API are called from the editor to display the results.<\/p>\n<p class=\"MsoNormal\">More information on testing can be gained from the blog : <a href=\"http:\/\/blogs.msdn.com\/vcblog\/archive\/2009\/03\/10\/testing-vc-compiler-and-intellisense.aspx\"><font color=\"#0000ff\">Testing VC++ Compiler and Intellisense<\/font><\/a><\/p>\n<p class=\"MsoNormal\">\n<p>&nbsp;<\/p>\n<\/p>\n<h2><font face=\"Cambria\" color=\"#4f81bd\" size=\"4\">Customer Impact &amp; Summary<\/font><\/h2>\n<p class=\"MsoNormal\"><span>Having this will enable customer to easily and accurately use cpp0x. Since cpp0x inevitable creates a thin level of wrapping on the underlying Cpp implementation, having intellisense and browsing will ensure better readability of the code. It would be a pity if such great C++ features are not used because the IDE is not intelligent enough to help the programmer navigate their complexity.<span>&nbsp; <\/span>With the changes we have made to the IDE and IntelliSense engine, we certainly hope we have taken care of that problem.<span>&nbsp; <\/span>We are excited about these new features and we hope you will like them too.<\/span><\/p>\n<p><\/font><\/p>\n<p><\/font><\/span><\/h2><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello Everyone, My name is Sunny Gupta and I am a SDET on VC++ IDE &amp; Compiler team. In this blog I will be talking about the IDE support for Cpp0x. &nbsp; What is C++0x?? C++0x is the name for the next version of the C++ Programming Language Standard.&nbsp; For VC 10, the C++ 0x [&hellip;]<\/p>\n","protected":false},"author":289,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[6,14],"class_list":["post-4333","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","tag-ide","tag-intellisense"],"acf":[],"blog_post_summary":"<p>Hello Everyone, My name is Sunny Gupta and I am a SDET on VC++ IDE &amp; Compiler team. In this blog I will be talking about the IDE support for Cpp0x. &nbsp; What is C++0x?? C++0x is the name for the next version of the C++ Programming Language Standard.&nbsp; For VC 10, the C++ 0x [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/4333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/289"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=4333"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/4333\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=4333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=4333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=4333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}