-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ea7673b
Showing
8 changed files
with
278 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set default behavior to automatically normalize line endings. | ||
* text=auto | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
*.vsix | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// A launch configuration that launches the extension inside a new window | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"runtimeExecutable": "${execPath}", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.vscode/** | ||
.vscode-test/** | ||
.gitignore | ||
vsc-extension-quickstart.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Change Log | ||
All notable changes to the "perch-language-support" extension will be documented in this file. | ||
|
||
## 1.0.0 | ||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Perch Language Support | ||
|
||
This package adds support for perch template tags inside of HTML files. | ||
|
||
## Features | ||
|
||
Feel free to suggest other improvements and suggestions. Pull Requests for bugs, improvements and features are welcome. | ||
|
||
* [x] Language Support inside of HTML files. | ||
* [ ] Add Snippets | ||
* [ ] Disable JS linter while inside the `source.perch` scope. | ||
* [ ] Intellisense | ||
* [ ] Hover to see docs for built-in tags | ||
* [ ] Validators for built-in tags | ||
|
||
## Known Issues | ||
|
||
This scope works inside of embedded script tags (i.e. `<script>`), though the [js] linter gets confused about syntax inside them. | ||
|
||
## Release Notes | ||
|
||
Users appreciate release notes as you update your extension. | ||
|
||
### 1.0.0 | ||
|
||
Initial release release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "perch-language-support", | ||
"displayName": "Perch Language Support", | ||
"description": "Language Support for the Perch CMS Template files", | ||
"version": "0.0.1", | ||
"publisher": "lachieh", | ||
"engines": { | ||
"vscode": "^1.25.0" | ||
}, | ||
"categories": [ | ||
"Programming Languages", | ||
"Snippets" | ||
], | ||
"contributes": { | ||
"grammars": [{ | ||
"scopeName": "text.html.perch", | ||
"injectTo": [ "text.html.basic" ], | ||
"path": "./syntaxes/perch.tmLanguage.json" | ||
}] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", | ||
"name": "Perch Template", | ||
"injectionSelector": "L:text.html.basic, source.js", | ||
"scopeName": "text.html.perch", | ||
"patterns": [ | ||
{ | ||
"name": "source.perch", | ||
"begin": "(</?perch:)([A-Za-z-]+)", | ||
"beginCaptures": { | ||
"1": { | ||
"name": "punctuation.definition.tag.begin.html.perch" | ||
}, | ||
"2": { | ||
"name": "entity.name.tag.block.any.html.perch" | ||
} | ||
}, | ||
"end": "(/?>)", | ||
"endCaptures": { | ||
"1": { | ||
"name": "punctuation.definition.tag.end.html.perch" | ||
} | ||
}, | ||
"patterns": [ | ||
{ | ||
"include": "#tag-stuff" | ||
} | ||
] | ||
} | ||
], | ||
"repository": { | ||
"entities": { | ||
"patterns": [ | ||
{ | ||
"captures": { | ||
"1": { | ||
"name": "punctuation.definition.entity.html.perch" | ||
}, | ||
"3": { | ||
"name": "punctuation.definition.entity.html.perch" | ||
} | ||
}, | ||
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#[xX][0-9a-fA-F]+)(;)", | ||
"name": "constant.character.entity.html.perch" | ||
}, | ||
{ | ||
"match": "&", | ||
"name": "invalid.illegal.bad-ampersand.html.perch" | ||
} | ||
] | ||
}, | ||
"string-double-quoted": { | ||
"begin": "\"", | ||
"beginCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.string.begin.html.perch" | ||
} | ||
}, | ||
"end": "\"", | ||
"endCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.string.end.html.perch" | ||
} | ||
}, | ||
"name": "string.quoted.double.html.perch", | ||
"patterns": [ | ||
{ | ||
"include": "#entities" | ||
} | ||
] | ||
}, | ||
"string-single-quoted": { | ||
"begin": "'", | ||
"beginCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.string.begin.html.perch" | ||
} | ||
}, | ||
"end": "'", | ||
"endCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.string.end.html.perch" | ||
} | ||
}, | ||
"name": "string.quoted.single.html.perch", | ||
"patterns": [ | ||
{ | ||
"include": "#entities" | ||
} | ||
] | ||
}, | ||
"tag-generic-attribute": { | ||
"patterns": [{ | ||
"match": "(?<=[^=])\\b([a-zA-Z0-9:-]+)", | ||
"name": "entity.other.attribute-name.html.perch" | ||
}] | ||
}, | ||
"tag-id-attribute": { | ||
"begin": "\\b(id)\\b\\s*(=)", | ||
"captures": { | ||
"1": { | ||
"name": "entity.other.attribute-name.id.html.perch" | ||
}, | ||
"2": { | ||
"name": "punctuation.separator.key-value.html.perch" | ||
} | ||
}, | ||
"end": "(?!\\G)(?<='|\"|[^\\s<>/])", | ||
"name": "meta.attribute-with-value.id.html.perch", | ||
"patterns": [ | ||
{ | ||
"begin": "\"", | ||
"beginCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.string.begin.html.perch" | ||
} | ||
}, | ||
"contentName": "meta.toc-list.id.html.perch", | ||
"end": "\"", | ||
"endCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.string.end.html.perch" | ||
} | ||
}, | ||
"name": "string.quoted.double.html.perch", | ||
"patterns": [ | ||
{ | ||
"include": "#embedded-code" | ||
}, | ||
{ | ||
"include": "#entities" | ||
} | ||
] | ||
}, | ||
{ | ||
"begin": "'", | ||
"beginCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.string.begin.html.perch" | ||
} | ||
}, | ||
"contentName": "meta.toc-list.id.html.perch", | ||
"end": "'", | ||
"endCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.string.end.html.perch" | ||
} | ||
}, | ||
"name": "string.quoted.single.html.perch", | ||
"patterns": [ | ||
{ | ||
"include": "#embedded-code" | ||
}, | ||
{ | ||
"include": "#entities" | ||
} | ||
] | ||
}, | ||
{ | ||
"captures": { | ||
"0": { | ||
"name": "meta.toc-list.id.html.perch" | ||
} | ||
}, | ||
"match": "(?<==)(?:[^\\s<>/'\"]|/(?!>))+", | ||
"name": "string.unquoted.html.perch" | ||
} | ||
] | ||
}, | ||
"tag-stuff": { | ||
"patterns": [ | ||
{ | ||
"include": "#tag-id-attribute" | ||
}, | ||
{ | ||
"include": "#tag-generic-attribute" | ||
}, | ||
{ | ||
"include": "#string-double-quoted" | ||
}, | ||
{ | ||
"include": "#string-single-quoted" | ||
}, | ||
{ | ||
"include": "#unquoted-attribute" | ||
} | ||
] | ||
}, | ||
"unquoted-attribute": { | ||
"patterns": [ | ||
{ | ||
"match": "(?<==)(?:[^\\s<>/'\"]|/(?!>))+", | ||
"name": "string.unquoted.html.perch" | ||
} | ||
] | ||
} | ||
} | ||
} |