Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a native api in vscode to match a document file by a glob?

I have a vscode.TextDocument and want to check if the file matches a glob.

like image 520
Alex Avatar asked Nov 27 '25 23:11

Alex


1 Answers

const documentFilter: vscode.DocumentFilter = {
    pattern: '**/*.md',
};
const matches = vscode.languages.match(documentFilter, document) !== 0;

Glob | vscode.d.ts

like image 172
Alex Avatar answered Nov 30 '25 13:11

Alex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!