A document filter denotes a document by different properties like the {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of its resource, or a glob-pattern that is applied to the {@link TextDocument.fileName path}.

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

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

Fields

@:optionaloptionalfinalread onlyscheme:Null<String>

A Uri {@link Uri.scheme scheme}, like file or untitled.

@:optionaloptionalfinalread onlypattern:Null<GlobPattern>

A {@link GlobPattern glob pattern} that is matched on the absolute path of the document. Use a {@link RelativePattern relative pattern} to filter documents to a {@link WorkspaceFolder workspace folder}.

@:optionaloptionalread onlynotebookType:Null<String>

The {@link NotebookDocument.notebookType type} of a notebook, like jupyter-notebook. This allows to narrow down on the type of a notebook that a {@link NotebookCell.document cell document} belongs to.

Note that setting the notebookType-property changes how scheme and pattern are interpreted. When set they are evaluated against the {@link NotebookDocument.uri notebook uri}, not the document uri.

@example Match python document inside jupyter notebook that aren't stored yet (untitled) { language: 'python', notebookType: 'jupyter-notebook', scheme: 'untitled' }

@:optionaloptionalread onlylanguage:Null<String>

A language id, like typescript.