Disabling Knockout Intellisense

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).  If it happens, some KnockoutJS IntelliSense will not be shown in the editor.  There are some workarounds you can do in order to show the knockout IntelliSense in time for such cases, such as using JavaScript XML documentation comments to speed up the IntelliSense evaluation.  For example, the following green comment will bypass the JQueryUI autocomplete evaluation and speed up the IntelliSense process.

$(document).ready(

function () {

    $(‘myInput’)

        .bind(“keydown”, function (event) {

        }).each(function () {          

             /// <returns value=”” />

            $(this).autocomplete({

                source: $(this).data(“test”)

            });

        });

});

Thanks.

Xinyang Qiu

 

==========  Original Post ========== 

Web Tools Extensions 1.2, which is part for the Web Platform Installer package named “Windows Azure SDK for .NET (VS 2012) 1.8.1 – February 2013” contains a new feature which provides Intellisense in web forms and web pages for KnockoutJS MVVM data binding.  You can verify that you have Web Tools Extension 1.2 installed by opening Visual Studio’s “About” dialog and scrolling through the installed products list to find:

                Web Developer Tools    1.2.40208.0

Unfortunately, upon installation several customers have reported slow-downs and lock-ups of Visual Studio when editing certain web pages containing Knockout syntax.  We are actively investigating this issue and hope to have a solution soon.  In the meantime, you can turn this feature OFF by doing the following:

  1. Create a file named TurnKoOff.txt and paste the following text into the file:
    Windows Registry Editor Version 5.00


    [HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio11.0HTML Editor]
    “KnockoutSupportEnabled”=”0”
  2. Create another file named TurnKoOn.txt and paste the following text in:
    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio11.0HTML Editor]
    “KnockoutSupportEnabled”=-
    NOTE: If you are running Visual Studio 2012 Express for Web rather than Visual Studio 2012 Professional, Premium or Ultimate, substitute “VWDExpress” for “VisualStudio”.
  3. Change the extensions of both files from “.txt” to “.reg.”.
  4. Ensure that Visual Studio (or Express for Web) is not running.
  5. Double-click TurnKoOff.reg.  You will receive the warning:
    ”Adding 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.”
  6. After exercising all appropriate caution, click “Yes”.
  7. Restart Visual Studio or Express for Web.

Knockout Intellisense will now be completely disabled.  It can be turned back on by double-clicking the TurnKoOn.reg file.

Please let us know if this solution does not work adequately for you.

We are interested in learning more about what cases some customers experience hangs and slow-downs.  Please share any information with us that you think will be helpful.