Skip to content

Commit 7d866f9

Browse files
committed
Add support for pug jade handlebars
1 parent e447612 commit 7d866f9

File tree

6 files changed

+55
-2
lines changed

6 files changed

+55
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Missing CSS support for HTML documents.
1919
- laravel-blade
2020
- razor
2121
- vue
22+
- pug
23+
- jade
24+
- hbs
2225

2326
## Optional resource.json
2427

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
"onLanguage:laravel-blade",
3232
"onLanguage:razor",
3333
"onLanguage:vue",
34-
"onLanguage:blade"
34+
"onLanguage:blade",
35+
"onLanguage:pug",
36+
"onLanguage:jade",
37+
"onLanguage:handlebars"
3538
],
3639
"contributes": {
3740
"jsonValidation": [

src/extension.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ export function activate(context: vsc.ExtensionContext) {
242242
let classServer = new ClassServer();
243243

244244
context.subscriptions.push(vsc.languages.registerCompletionItemProvider(
245-
['html', 'laravel-blade', 'razor', 'vue', 'blade'], classServer));
245+
['html', 'laravel-blade', 'razor', 'vue', 'blade', 'pug', 'jade', 'handlebars'], classServer));
246246

247247
// https://github.com/Microsoft/vscode/issues/13675
248248
let wp = /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\.\"\,\<\>\/\?\s]+)/g;
@@ -266,6 +266,18 @@ export function activate(context: vsc.ExtensionContext) {
266266
context.subscriptions.push(vsc.languages.setLanguageConfiguration('blade', {
267267
wordPattern: wp
268268
}));
269+
270+
context.subscriptions.push(vsc.languages.setLanguageConfiguration('pug', {
271+
wordPattern: wp
272+
}));
273+
274+
context.subscriptions.push(vsc.languages.setLanguageConfiguration('jade', {
275+
wordPattern: wp
276+
}));
277+
278+
context.subscriptions.push(vsc.languages.setLanguageConfiguration('handlebars', {
279+
wordPattern: wp
280+
}));
269281
}
270282

271283
export function deactivate() {

test/test.hbs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<html>
2+
3+
<head>
4+
<style>
5+
.internal {
6+
color: red;
7+
}
8+
9+
.internal-test1 .internal-test2 {
10+
color: red;
11+
}
12+
13+
#internal_id {
14+
color: red;
15+
}
16+
17+
#internal_id-test1 #internal_id-test2 {
18+
color: red;
19+
}
20+
</style>
21+
</head>
22+
23+
<body>
24+
<a href="#" id="external_id" style="color: white;" class="external">TEST</a>
25+
<a href="#" id="internal_id" style="
26+
color: white;
27+
background-color: red;" class="
28+
external
29+
internal
30+
">TEST</a>
31+
</body>
32+
33+
</html>

test/test.jade

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a(class='external-test1' href='google.com') Google

test/test.pug

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a(class='external-test1' href='google.com') Google

0 commit comments

Comments
 (0)