Partilhar via


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.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)

Syntax

'Declaração
Public Property SearchPaths As String
public string SearchPaths { get; set; }

Property Value

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

Remarks

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]\
    Paths\
      (Default)       = reg_sz:
      [Language Name] = reg_sz: [SearchPaths]

Examples

    [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";
                         )]

.NET Framework Security

See Also

Reference

ProvideLanguageCodeExpansionAttribute Class

Microsoft.VisualStudio.Shell Namespace

Other Resources

Support for Code Snippets (Managed Package Framework)