Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ You can request new features and/or contribute to the extension development on i
Check out the [change log](https://github.com/zignd/HTML-CSS-Class-Completion/blob/master/CHANGELOG.md) for the current and previous updates.

## Usage
If there are HTML files on your workspace, the extension automatically starts and looks for CSS class definitions. In case new CSS classes are defined or new CSS files are added to the workspace and you also want auto completion for them, simply hit the lightning icon on the status bar and execute the command by pressing `Ctrl+Shift+P`(`cmd+Shift+P` for Mac) and then typing "Cache CSS class definitions".
If there are HTML or JS files on your workspace, the extension automatically starts and looks for CSS class definitions. In case new CSS classes are defined or new CSS files are added to the workspace and you also want auto completion for them, simply hit the lightning icon on the status bar and execute the command by pressing `Ctrl+Shift+P`(`cmd+Shift+P` for Mac) and then typing "Cache CSS class definitions".

You can omit or exclusively include the folders to search for by using these configurations:
`css-class-completion.includeGlobPattern` or `css-class-completion.excludeGlobPattern`.

![](https://i.imgur.com/O7NjEUW.gif)
![](https://i.imgur.com/uyiXqMb.gif)
19 changes: 18 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@
"command": "html-css-class-completion.cache",
"title": "Cache CSS class definitions"
}
],
"configuration": [
{
"title": "CSS Class Completion",
"properties": {
"html-css-class-completion.includeGlobPattern": {
"type": "string",
"default": "**/*.{css,html}",
"description": "A glob pattern that defines files and folders to search for. The glob pattern will be matched against the paths of resulting matches relative to their workspace."
},
"html-css-class-completion.excludeGlobPattern": {
"type": "string",
"default": "",
"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."
}
}
}
]
},
"icon": "images/icon.png",
Expand Down Expand Up @@ -60,4 +77,4 @@
"request": "^2.81.0",
"request-promise": "^4.2.1"
}
}
}
5 changes: 3 additions & 2 deletions src/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import ParseEngineRegistry from './parse-engines/parse-engine-registry';

class Fetcher {
static async findAllParseableDocuments(): Promise<vscode.Uri[]> {
const languages = ParseEngineRegistry.supportedLanguagesIds.join(',');
const includeGlobPattern = vscode.workspace.getConfiguration().get('html-css-class-completion.includeGlobPattern');
const excludeGlobPattern = vscode.workspace.getConfiguration().get('html-css-class-completion.excludeGlobPattern');

return await vscode.workspace.findFiles(`**/*.{${languages}}`, '');
return await vscode.workspace.findFiles(`${includeGlobPattern}`, `${excludeGlobPattern}`);
}
}

Expand Down