• Public
  • Public/Protected
  • All

Interface DocumentFilter

A document filter denotes a document by different properties like the language, the scheme of its resource, or a glob-pattern that is applied to the path. A document filter matches if all the provided properties (those of language, scheme and pattern that are not undefined) match. If all properties are undefined, the document filter matches all documents.


// A language filter that applies to typescript files on disk
{ language: 'typescript', scheme: 'file' }

// A language filter that applies to all package.json paths
{ language: 'json', pattern: '**package.json' }


  • DocumentFilter



Optional baseUri

baseUri: URL | string

A base URI (e.g. root URI of a workspace folder) that the document must be within.

Optional language

language: undefined | string

A language id, such as typescript or *.

Optional pattern

pattern: undefined | string

A glob pattern, such as *.{ts,js}.

Optional scheme

scheme: undefined | string

A URI scheme, such as file or untitled.

Generated using TypeDoc