DocumentFilter Class

Definition

Describes an applicability condition based on the type or path of a document.

public sealed class DocumentFilter : IEquatable<Microsoft.VisualStudio.Extensibility.DocumentFilter>
type DocumentFilter = class
    interface IEquatable<DocumentFilter>
Public NotInheritable Class DocumentFilter
Implements IEquatable(Of DocumentFilter)
Inheritance
DocumentFilter
Implements

Constructors

DocumentFilter()

Properties

DocumentType

Gets the document type of an object. Document type is frequently used to target specific languages.

Pattern

Gets the glob pattern to match document file path. Glob patterns can have the following syntax:

  • to match one or more characters in a path segment ? to match on one character in a path segment ** to match any number of path segments, including none {} to group conditions (e.g. **/*.{ts,js} matches all TypeScript and JavaScript files) [] to declare a range of characters to match in a path segment (e.g., example.[0-9] to match on example.0, example.1, …) [!...] to negate a range of characters to match in a path segment (e.g., example.[!0-9] to match on example.a, example.b, but not example.0) Note: a backslash () is not valid within a glob pattern. If you have an existing file path to match against, consider to use the relative pattern support that takes care of converting any backslash into slash. Otherwise, make sure to convert any backslash to slash when creating the glob pattern.
RelativePath

Gets a value indicating whether the pattern should be applied to the absolute path of a file or to a path relative to the solution folder.

Methods

Equals(DocumentFilter)

Indicates whether the current object is equal to another object of the same type.

Equals(Object)

Determines whether the specified object is equal to the current object.

FromDocumentType(DocumentType)

Creates a DocumentFilter from a document type.

FromDocumentType(DocumentTypeConfiguration)

Creates a DocumentFilter from a document type.

FromGlobPattern(String, Boolean)

Creates a DocumentFilter from a glob pattern matching the document file path.

GetHashCode()

Serves as the default hash function.

Applies to