Skip to content

Commit

Permalink
Start adding other languages support. SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
0x00000001A committed Aug 12, 2018
1 parent 789570e commit 877f19e
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ The format is based on [Keep a Changelog] (http://keepachangelog.com/en/1.0.0/)
### [1.5.0] - 2018-03-22
### Fixed
- Compatibility with Prettier

### [1.6.0] - 2018-08-13
### Added
- SQL support. Beta
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# ES6 String HTML
> [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=Tobermory.es6-string-html)
Adds syntax highlight support for html placed in es6 multiline strings
Adds syntax highlight support for code, placed in es6 multiline strings:
- HTML
- SQL

## Installation

Expand All @@ -13,7 +15,7 @@ Adds syntax highlight support for html placed in es6 multiline strings

## Usage

Simply insert the comment /\*html\*/ or `html` before the string
Simply insert the comment /\*html\*/ or `html` (or sql instead of html) before the string
(see Requirements "section" for possible values) or select
`Insert es6-string-html comment/template` from the commands menu
(`ctrl+shift+p` or `f1`)
Expand Down Expand Up @@ -63,6 +65,9 @@ If this project help you reduce time to develop, you can give me a cup of coffee
### [1.5.0] - 2018-03-22
- Compatibility with Prettier

### [1.6.0] - 2018-08-13
- Add SQL support. Beta

-----------------------------------------------------------------------------------------------------------

**Enjoy!**
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 27 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "es6-string-html",
"displayName": "es6-string-html",
"description": "Highlight html in es6 multiline strings",
"version": "1.5.0",
"description": "Highlight different languages in es6 multiline strings",
"version": "1.6.0",
"publisher": "Tobermory",
"icon": "docs/logo.png",
"engines": {
Expand All @@ -19,8 +19,16 @@
"url": "https://github.com/mydesireiscoma/es6-string-html/issues"
},
"main": "./scripts/main",
"categories": ["Languages"],
"keywords": ["javascript", "es6", "es6-string-html", "html", "template"],
"categories": [
"Languages"
],
"keywords": [
"javascript",
"es6",
"es6-string-html",
"html",
"template"
],
"activationEvents": [
"onCommand:es6stringhtml.insertComment",
"onCommand:es6stringhtml.insertTemplate"
Expand Down Expand Up @@ -67,6 +75,21 @@
"embeddedLanguages": {
"meta.embedded.block.html": "html"
}
},
{
"injectTo": [
"source.js",
"source.js.jsx",
"source.jsx",
"source.ts",
"source.tsx",
"source.sql"
],
"scopeName": "inline.es6-sql",
"path": "./syntaxes/es6-inline-sql.json",
"embeddedLanguages": {
"meta.embedded.sql": "sql"
}
}
]
}
Expand Down
60 changes: 60 additions & 0 deletions syntaxes/es6-inline-sql.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"fileTypes": [
"js",
"jsx",
"ts",
"tsx"
],
"injectionSelector": "L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string",
"injections": {
"L:source": {
"patterns": [
{
"match": "<",
"name": "invalid.illegal.bad-angle-bracket.html"
}
]
}
},
"patterns": [
{
"begin": "(\\s?\\/?\\*?\\s?(sql|inline-sql)\\s?\\*?\\/?\\s?)(`)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.comment.js"
}
},
"end": "(`)",
"patterns": [
{
"include": "source.ts#template-substitution-element"
},
{
"include": "source.sql"
}
]
},
{
"begin": "(\\/\\/\\s?(sql|inline-sql)\\s?)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.comment.js"
}
},
"end": "(`)",
"patterns": [
{
"begin": "(\\G)",
"end": "(`)"
},
{
"include": "source.ts#template-substitution-element"
},
{
"include": "source.sql"
}
]
}
],
"scopeName": "inline.es6-sql"
}

0 comments on commit 877f19e

Please sign in to comment.