ProvideLanguageCodeExpansionAttribute.SearchPaths Property

Gets or sets a semicolon-delimited string containing the default paths to search for snippets.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)

public string SearchPaths { get; set; }

Property Value

Type: System.String
Returns a semicolon-delimited string containing the paths to search for snippets.

The paths specified by this option are a semi-colon-delimited list and are used to look for snippets if the index file cannot be found. The search paths can contain certain substitution variables; see Support for Code Snippets (Managed Package Framework) for details.

This property is available to any language service implementation.

The registry entry looks like this:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\[X.Y]\Languages\Language Services\CodeExpansions\
  [Language Name]\
      (Default)       = reg_sz:
      [Language Name] = reg_sz: [SearchPaths]

    [ProvideCodeExpansion(typeof(MyLanguageService),            // Required
                            MyConstants.languageName,           // Required
                            MyConstants.languageNameResourceID, // Required
                            MyConstants.languageIdentifier,     // Required
                            MyConstants.snippetsIndexFilePath,  // Required
        // Optional code expansion properties
        SearchPaths = @"%InstallRoot%\MyLanguage\Snippets\%LCID%\Snippets;" +
                      @"\%MyDocs%\Code Snippets\MyLanguage\My Code Snippets";

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft