{"id":21999,"date":"2013-03-04T13:40:17","date_gmt":"2013-03-04T20:40:17","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/aspnet\/?p=21999"},"modified":"2013-03-04T13:40:17","modified_gmt":"2013-03-04T20:40:17","slug":"disabling-knockout-intellisense","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/disabling-knockout-intellisense\/","title":{"rendered":"Disabling Knockout Intellisense"},"content":{"rendered":"<p>Update 4\/4\/2013: This problem is fixed in <a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkId=273878\">Visual Studio 2012 Update 2<\/a> (VS2012.2). If the internal JavaScript engine could not figure out the IntelliSense in one second, VS will time out instead of keep evaluating (which in some cases can slow down VS significantly).\u00a0 If it happens, some KnockoutJS IntelliSense will not be shown in the editor.\u00a0 There are some workarounds you can do in order to show the knockout IntelliSense in time for such cases, such as using <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/hh524453.aspx\">JavaScript XML documentation comments<\/a> to speed up the IntelliSense evaluation.\u00a0 For example, the following green comment will bypass the JQueryUI autocomplete evaluation and speed up the IntelliSense process.<\/p>\n<p>$(document).ready(<\/p>\n<p><span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\"><span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\"><span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\">function<\/span><\/span><\/span><span style=\"font-family: Consolas;font-size: x-small\"><span style=\"font-family: Consolas;font-size: x-small\"> () {<\/span><\/span><\/p>\n<p>\u00a0\u00a0\u00a0 $(<span style=\"color: #a31515;font-family: Consolas;font-size: x-small\"><span style=\"color: #a31515;font-family: Consolas;font-size: x-small\"><span style=\"color: #a31515;font-family: Consolas;font-size: x-small\">&#8216;myInput&#8217;<\/span><\/span><\/span><span style=\"font-family: Consolas;font-size: x-small\"><span style=\"font-family: Consolas;font-size: x-small\">)<\/span><\/span><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 .bind(<span style=\"color: #a31515;font-family: Consolas;font-size: x-small\"><span style=\"color: #a31515;font-family: Consolas;font-size: x-small\"><span style=\"color: #a31515;font-family: Consolas;font-size: x-small\">&#8220;keydown&#8221;<\/span><\/span><\/span><span style=\"font-family: Consolas;font-size: x-small\"><span style=\"font-family: Consolas;font-size: x-small\">, <\/span><\/span><span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\"><span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\"><span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\">function<\/span><\/span><\/span><span style=\"font-family: Consolas;font-size: x-small\"><span style=\"font-family: Consolas;font-size: x-small\"> (event) {<\/span><\/span><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }).each(<span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\"><span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\"><span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\">function<\/span><\/span><\/span><span style=\"font-family: Consolas;font-size: x-small\"><span style=\"font-family: Consolas;font-size: x-small\"> () {<\/span><\/span>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<strong><span style=\"color: #008000;font-family: Consolas;font-size: x-small\"><span style=\"color: #008000;font-family: Consolas;font-size: x-small\"><span style=\"color: #008000;font-family: Consolas;font-size: x-small\">\/\/\/ <\/span><\/span><\/span><\/strong><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 $(<span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\"><span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\"><span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\">this<\/span><\/span><\/span><span style=\"font-family: Consolas;font-size: x-small\"><span style=\"font-family: Consolas;font-size: x-small\">).autocomplete({<\/span><\/span><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 source: $(<span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\"><span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\"><span style=\"color: #0000ff;font-family: Consolas;font-size: x-small\">this<\/span><\/span><\/span><span style=\"font-family: Consolas;font-size: x-small\"><span style=\"font-family: Consolas;font-size: x-small\">).data(<\/span><\/span><span style=\"color: #a31515;font-family: Consolas;font-size: x-small\"><span style=\"color: #a31515;font-family: Consolas;font-size: x-small\"><span style=\"color: #a31515;font-family: Consolas;font-size: x-small\">&#8220;test&#8221;<\/span><\/span><\/span><span style=\"font-family: Consolas;font-size: x-small\"><span style=\"font-family: Consolas;font-size: x-small\">)<\/span><\/span><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 });<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 });<\/p>\n<p>});<\/p>\n<p>Thanks.<\/p>\n<p>Xinyang Qiu<\/p>\n<p>\u00a0<\/p>\n<p>==========\u00a0 Original Post ==========\u00a0<\/p>\n<p>Web Tools Extensions 1.2, which is part for the Web Platform Installer package named \u201cWindows Azure SDK for .NET (VS 2012) 1.8.1 \u2013 February 2013\u201d contains a new feature which provides Intellisense in web forms and web pages for KnockoutJS MVVM data binding.\u00a0 You can verify that you have Web Tools Extension 1.2 installed by opening Visual Studio\u2019s \u201cAbout\u201d dialog and scrolling through the installed products list to find:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Web Developer Tools\u00a0\u00a0\u00a0 1.2.40208.0<\/p>\n<p>Unfortunately, upon installation several customers have reported slow-downs and lock-ups of Visual Studio when editing certain web pages containing Knockout syntax.\u00a0 We are actively investigating this issue and hope to have a solution soon.\u00a0 In the meantime, you can turn this feature OFF by doing the following:<\/p>\n<ol>\n<li>Create a file named TurnKoOff.txt and paste the following text into the file:<br \/>\n<span style=\"background-color: #ffff00\">Windows Registry Editor Version 5.00 <br \/><\/span><span style=\"background-color: #ffff00\"> <\/p>\n<p>[HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio11.0HTML Editor] <br \/><\/span><span style=\"background-color: #ffff00\">&#8220;KnockoutSupportEnabled&#8221;=&#8221;0&#8221;<\/span><\/li>\n<li>Create another file named TurnKoOn.txt and paste the following text in:<br \/>\n<span style=\"background-color: #ffff00\">Windows Registry Editor Version 5.00 <\/p>\n<p><\/span><span style=\"background-color: #ffff00\">[HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio11.0HTML Editor] <br \/><\/span><span style=\"background-color: #ffff00\">&#8220;KnockoutSupportEnabled&#8221;=- <br \/><\/span><strong>NOTE<\/strong>: If you are running Visual Studio 2012 Express for Web rather than Visual Studio 2012 Professional, Premium or Ultimate, substitute \u201cVWDExpress\u201d for \u201cVisualStudio\u201d.<\/li>\n<li>Change the extensions of both files from \u201c.txt\u201d to \u201c.reg.\u201d.<\/li>\n<li>Ensure that Visual Studio (or Express for Web) is not running.<\/li>\n<li>Double-click TurnKoOff.reg.\u00a0 You will receive the warning:<br \/>\n\u201dAdding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in TurnKoOff.reg, do not add it to the registry.\u201d<\/li>\n<li>After exercising all appropriate caution, click \u201cYes\u201d.<\/li>\n<li>Restart Visual Studio or Express for Web.<\/li>\n<\/ol>\n<p>Knockout Intellisense will now be completely disabled.\u00a0 It can be turned back on by double-clicking the TurnKoOn.reg file.<\/p>\n<p>Please let us know if this solution does not work adequately for you.<\/p>\n<p>We are interested in learning more about what cases some customers experience hangs and slow-downs.\u00a0 Please share any information with us that you think will be helpful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update 4\/4\/2013: This problem is fixed in Visual Studio 2012 Update 2 (VS2012.2). If the internal JavaScript engine could not figure out the IntelliSense in one second, VS will time out instead of keep evaluating (which in some cases can slow down VS significantly).\u00a0 If it happens, some KnockoutJS IntelliSense will not be shown in [&hellip;]<\/p>\n","protected":false},"author":433,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[7276,7372,7423],"class_list":["post-21999","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","tag-intellisense","tag-javascript","tag-knockout"],"acf":[],"blog_post_summary":"<p>Update 4\/4\/2013: This problem is fixed in Visual Studio 2012 Update 2 (VS2012.2). If the internal JavaScript engine could not figure out the IntelliSense in one second, VS will time out instead of keep evaluating (which in some cases can slow down VS significantly).\u00a0 If it happens, some KnockoutJS IntelliSense will not be shown in [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/21999","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\/433"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=21999"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/21999\/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=21999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=21999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=21999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}