Skip to content

Commit 52a3136

Browse files
committed
Merge remote-tracking branch 'zignd/master'
2 parents 9eb5b93 + d5df38e commit 52a3136

File tree

4 files changed

+25
-31
lines changed

4 files changed

+25
-31
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### 1.13.0 (Nov 6, 2017)
2+
* Added support for Laravel (Blade).
3+
14
### 1.12.0 (Out 31, 2017)
25
* Added the "multi-root ready" keyword, it was a request from the VS Code team.
36

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ A Visual Studio Code extension that provides CSS class name completion for the H
1313
* HTML
1414
* Razor
1515
* PHP
16+
* Laravel (Blade)
1617
* JavaScript
1718
* JavaScript React (.jsx)
1819
* TypeScript React (.tsx)
@@ -23,11 +24,14 @@ A Visual Studio Code extension that provides CSS class name completion for the H
2324
* Handlebars
2425
* EJS (.ejs)
2526

27+
## Library Specific Support
28+
* @apply in CSS, SASS and SCSS Files for [Tailwind CSS](https://tailwindcss.com)
29+
2630
## Contributions
2731
You can request new features and/or contribute to the extension development on its [repository on GitHub](https://github.com/Zignd/HTML-CSS-Class-Completion/issues). Look for an issue you're interested in working on, comment on it to let me know you're working on it and submit your pull request! :D
2832

29-
## What's new in version 1.12.0 (Out 31, 2017)
30-
* Added the "multi-root ready" keyword, it was a request from the VS Code team.
33+
## What's new in version 1.13.0 (Nov 6, 2017)
34+
* Added support for Laravel (Blade).
3135

3236
Check out the [change log](https://github.com/zignd/HTML-CSS-Class-Completion/blob/master/CHANGELOG.md) for the current and previous updates.
3337

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "html-css-class-completion",
33
"displayName": "IntelliSense for CSS class names",
44
"description": "Provides CSS class name completion for the HTML class attribute based on the CSS files in your workspace. Also supports React's className attribute.",
5-
"version": "1.12.0",
5+
"version": "1.13.0",
66
"publisher": "Zignd",
77
"engines": {
88
"vscode": "^1.4.0"

src/extension.ts

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -122,34 +122,21 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
122122
}
123123
}));
124124

125-
const htmlRegex = /class=["|']([\w- ]*$)/;
126-
const jsxRegex = /className=["|']([\w- ]*$)/;
127-
128-
const html = provideCompletionItemsGenerator('html', htmlRegex);
129-
const razor = provideCompletionItemsGenerator('razor', htmlRegex);
130-
const php = provideCompletionItemsGenerator('php', htmlRegex);
131-
const vue = provideCompletionItemsGenerator('vue', htmlRegex);
132-
const twig = provideCompletionItemsGenerator('twig', htmlRegex);
133-
const md = provideCompletionItemsGenerator('markdown', htmlRegex);
134-
const tsReact = provideCompletionItemsGenerator('typescriptreact', jsxRegex);
135-
const js = provideCompletionItemsGenerator('javascript', jsxRegex)
136-
const jsReact = provideCompletionItemsGenerator('javascriptreact', jsxRegex);
137-
const erb = provideCompletionItemsGenerator('erb', htmlRegex);
138-
const hbs = provideCompletionItemsGenerator('handlebars', htmlRegex);
139-
const ejs = provideCompletionItemsGenerator('ejs', htmlRegex);
140-
141-
context.subscriptions.push(html);
142-
context.subscriptions.push(razor);
143-
context.subscriptions.push(php);
144-
context.subscriptions.push(vue);
145-
context.subscriptions.push(twig);
146-
context.subscriptions.push(md);
147-
context.subscriptions.push(tsReact);
148-
context.subscriptions.push(js);
149-
context.subscriptions.push(jsReact);
150-
context.subscriptions.push(erb);
151-
context.subscriptions.push(hbs);
152-
context.subscriptions.push(ejs);
125+
// Javascript based extensions
126+
['typescriptreact', 'javascript', 'javascriptreact'].forEach((extension) => {
127+
context.subscriptions.push(provideCompletionItemsGenerator(extension, /className=["|']([\w- ]*$)/));
128+
});
129+
130+
// HTML based extensions
131+
['html', 'razor', 'php', 'blade', 'vue', 'twig', 'markdown', 'erb', 'handlebars', 'ejs'].forEach((extension) => {
132+
context.subscriptions.push(provideCompletionItemsGenerator(extension, /class=["|']([\w- ]*$)/));
133+
});
134+
135+
// CSS based extensions
136+
['css', 'sass', 'scss'].forEach((extension) => {
137+
// Support for Tailwind CSS
138+
context.subscriptions.push(provideCompletionItemsGenerator(extension, /@apply ([\w- ]*$)/));
139+
});
153140

154141
caching = true;
155142
try {

0 commit comments

Comments
 (0)