Skip to content

Commit

Permalink
Added laravel-blade support
Browse files Browse the repository at this point in the history
  • Loading branch information
Ecmel Ercan authored and Ecmel Ercan committed Jul 20, 2016
1 parent 22d3897 commit defd979
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ CSS support in HTML documents.
- Supports optional resource.json file for fine tuned resource selection.
- Uses [vscode-css-languageservice](https://github.com/Microsoft/vscode-css-languageservice).

## resource.json
## Supported Languages

If a resource.json file is found in the root of the workspace, only files listed in the file will be
used for class attribute completion.
- html
- laravel-blade

## Optional resource.json

If a resource.json file is found in the root of the workspace, only files listed in the file will be used for class attribute completion.

### Example

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-html-css",
"displayName": "HTML CSS Support",
"description": "CSS support in HTML documents",
"version": "0.0.17",
"version": "0.0.18",
"publisher": "ecmel",
"license": "MIT",
"homepage": "https://github.com/ecmel/vscode-html-css",
Expand All @@ -23,7 +23,8 @@
"attribute"
],
"activationEvents": [
"onLanguage:html"
"onLanguage:html",
"onLanguage:laravel-blade"
],
"contributes": {
"jsonValidation": [
Expand Down
9 changes: 6 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,15 @@ export function activate(context: vsc.ExtensionContext) {

let styleServer = new StyleServer();

context.subscriptions.push(vsc.languages.registerCompletionItemProvider('html', styleServer));
context.subscriptions.push(vsc.languages.registerHoverProvider('html', styleServer));
context.subscriptions.push(vsc.languages.registerCompletionItemProvider(
['html', 'laravel-blade'], styleServer));
context.subscriptions.push(vsc.languages.registerHoverProvider(
['html', 'laravel-blade'], styleServer));

let classServer = new ClassServer();

context.subscriptions.push(vsc.languages.registerCompletionItemProvider('html', classServer));
context.subscriptions.push(vsc.languages.registerCompletionItemProvider(
['html', 'laravel-blade'], classServer));
}

export function deactivate() {
Expand Down
11 changes: 11 additions & 0 deletions test/test.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<html>
<head>
<style>
.test {
color: red;
}
</style>
</head>
<body class="external test">
</body>
</html>

0 comments on commit defd979

Please sign in to comment.