Skip to content

Commit 0697b18

Browse files
committed
add include and exclude globPatterns as configuration
1 parent 4356d0d commit 0697b18

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

package.json

+18-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,23 @@
2727
"command": "html-css-class-completion.cache",
2828
"title": "Cache CSS class definitions"
2929
}
30+
],
31+
"configuration": [
32+
{
33+
"title": "CSS Class Completion",
34+
"properties": {
35+
"css-class-completion.includeGlobPattern": {
36+
"type": "string",
37+
"default": "**/*",
38+
"description": "A glob pattern that defines the folders to search for. The glob pattern will be matched against the paths of resulting matches relative to their workspace."
39+
},
40+
"css-class-completion.excludeGlobPattern": {
41+
"type": "string",
42+
"default": "node_modules∕*",
43+
"description": "A glob pattern that defines files and folders to exclude. The glob pattern will be matched against the file paths of resulting matches relative to their workspace."
44+
}
45+
}
46+
}
3047
]
3148
},
3249
"icon": "images/icon.png",
@@ -60,4 +77,4 @@
6077
"request": "^2.81.0",
6178
"request-promise": "^4.2.1"
6279
}
63-
}
80+
}

src/fetcher.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ class Fetcher {
55
static async findAllParseableDocuments(): Promise<vscode.Uri[]> {
66
const languages = ParseEngineRegistry.supportedLanguagesIds.join(',');
77

8-
return await vscode.workspace.findFiles(`**/*.{${languages}}`, '');
8+
const includeGlobPattern = vscode.workspace.getConfiguration().get('css-class-completion.includeGlobPattern');
9+
const excludeGlobPattern = vscode.workspace.getConfiguration().get('css-class-completion.excludeGlobPattern');
10+
11+
return await vscode.workspace.findFiles(`${includeGlobPattern}.{${languages}}`, `${excludeGlobPattern}`);
912
}
1013
}
1114

0 commit comments

Comments
 (0)