Skip to content

Commit ec95f7c

Browse files
author
Peter Weir
committed
Merge branch 'debugging'
2 parents 8112d75 + f916c2d commit ec95f7c

File tree

10 files changed

+64
-393
lines changed

10 files changed

+64
-393
lines changed

CHANGELOG.md

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,55 +5,6 @@ The format is based on [Keep a Changelog] (http://keepachangelog.com/en/1.0.0/)
55

66
## [Unreleased]
77

8-
## [1.0.0] - 2018-02-02
8+
## [0.0.1] - 2018-03-28
99
### Added
10-
- Syntax highlighting for html in es6 multiline strings
11-
12-
## [1.1.0] - 2018-03-08
13-
### Fixed
14-
- Compatibility with Prettier
15-
16-
## [1.2.0] - 2018-03-12
17-
### Added
18-
- Commands and keybindings
19-
20-
## [1.3.0] - 2018-03-17
21-
### Added
22-
- Syntax highlight without a comment
23-
- Follow semver
24-
25-
### [1.4.0] - 2018-03-22
26-
### Added
27-
- JS Syntax highlight
28-
- Single-line comment support
29-
30-
### [1.5.0] - 2018-03-22
31-
### Fixed
32-
- Compatibility with Prettier
33-
34-
### [1.6.0] - 2018-08-13
35-
### Added
36-
- SQL support. Beta
37-
38-
### [1.7.0] - 2018-08-14
39-
### Fixed
40-
- Improve html function support
41-
42-
### [1.7.1] - 2018-08-15
43-
### Fixed
44-
- Improve single-line comments support
45-
- Disable hotkeys
46-
47-
### [1.8.1] - 2018-08-18
48-
### Added
49-
- Unquoted attributes support
50-
### Fixed
51-
- Js-in-attributes support
52-
53-
### [1.8.2] - 2018-08-19
54-
### Fixed
55-
- Fix missing `${}` syntax support in sql
56-
57-
### [1.8.3] - 2018-08-25
58-
### Fixed
59-
- Fix broken multiline support for jquery
10+
- First working version

README.md

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,28 @@
11
# Python String HTML
22
> Hopefully ready to add to the VSCode Marketplace soon
33
4-
Adds syntax highlight support for code, placed in python multiline strings:
5-
- HTML (incl. html quoted and unquoted attrs)
6-
- SQL
4+
Adds syntax highlight support for code, placed in python multiline SQL strings
75

86
## Community
97
- 2018-09-04 forked from [es6-string-css](https://github.com/bashmish/es6-string-css) - Highlight CSS in ES6 template literals
108

119
## Installation
1210

13-
- Install `python-string-html` from extensions (`ctrl + shift + x`)
11+
- Install `python-string-sql` from extensions (`ctrl + shift + x`)
1412

1513
## Example
1614

1715
![Example](docs/demo.png)
1816

1917
## Usage
2018

21-
Simply insert the comment /\*html\*/ or `html` (or sql instead of html) before the string
22-
(see Requirements "section" for possible values) or select
23-
`Insert python-string-html comment/template` from the commands menu
24-
(`ctrl+shift+p` or `f1`)
25-
26-
> Tip: Comment in the beginning of python string is required
19+
Simply insert `--sql`, `--beginsql`, or `--begin-sql` at the beginning of the string
20+
and `--endsql` or `--end-sql` at the end of the string
2721

2822
## Requirements
2923

30-
- Visual Studio Code v1.19.0 recommended
31-
- Comment `/*html*/` before the string. Possible values:
32-
- - `/*html*/`
33-
- - `/*inline-html*/`
34-
- - `/*template*/`
35-
- - `/*inline-template*/`
36-
- Or
37-
- - `html` before the string
38-
39-
## Keybindings
40-
- `ctrl+shift+h` - Insert `/*html*/`
41-
- `ctrl+k h` - Insert `/*html*/` \`\`
24+
- Visual Studio Code v1.32.0 recommended
25+
- Comment `--sql` to start highlighting in the string. Possible values:
4226

4327
## Donation
4428

@@ -48,6 +32,9 @@ If this project help you reduce time to develop, you can give the original devel
4832

4933
## Release Notes
5034

35+
### [0.0.1] - 2018-09-04
36+
- Got it working based on [these instructions](https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide)
37+
5138
### [0.0.0] - 2018-09-04
5239
- Forked from es6-string-html
5340

docs/logo.png

-4.93 KB
Binary file not shown.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 24 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,28 @@
11
{
2-
"name": "python-string-html",
3-
"displayName": "python-string-html",
4-
"description": "Syntax highlighting in Python multiline strings",
5-
"version": "0.0.0",
6-
"publisher": "ptweir",
7-
"icon": "docs/logo.png",
8-
"engines": {
9-
"vscode": "^1.19.0"
10-
},
11-
"galleryBanner": {
12-
"color": "#dedede",
13-
"theme": "light"
14-
},
15-
"repository": {
16-
"url": "https://github.com/ptweir/python-string-html"
17-
},
18-
"bugs": {
19-
"url": "https://github.com/ptweir/python-string-html/issues"
20-
},
21-
"main": "./scripts/main",
22-
"categories": [
23-
"Languages"
24-
],
25-
"keywords": [
26-
"python",
27-
"python3",
28-
"python-string-html",
29-
"html",
30-
"sql"
31-
],
32-
"activationEvents": [
33-
"onCommand:pythonstringhtml.insertComment",
34-
"onCommand:pythonstringhtml.insertTemplate"
35-
],
36-
"contributes": {
37-
"commands": [
38-
{
39-
"command": "pythonstringhtml.insertComment",
40-
"title": "Insert python-string-html comment",
41-
"category": "HTML"
2+
"name": "python-string-sql",
3+
"displayName": "python-string-sql",
4+
"description": "highlight python strings as sql",
5+
"version": "0.0.1",
6+
"publisher": "ptweir",
7+
"repository": {
8+
"url": "https://github.com/ptweir/python-string-html"
429
},
43-
{
44-
"command": "pythonstringhtml.insertTemplate",
45-
"title": "Insert python-string-html template",
46-
"category": "HTML"
47-
}
10+
"engines": {
11+
"vscode": "^1.32.0"
12+
},
13+
"categories": [
14+
"Programming Languages"
4815
],
49-
"grammars": [
50-
{
51-
"injectTo": [
52-
"source.js",
53-
"source.js.jsx",
54-
"source.jsx",
55-
"source.ts",
56-
"source.tsx",
57-
"source.sql",
58-
"text.html.basic"
59-
],
60-
"scopeName": "inline.es6-js-injection",
61-
"path": "./syntaxes/es6-js-injection.json",
62-
"embeddedLanguages": {
63-
"meta.template.expression.ts": "typescript",
64-
"meta.template.expression.js": "javascript"
65-
}
66-
},
67-
{
68-
"injectTo": [
69-
"source.py",
70-
"source.ts",
71-
"source.tsx",
72-
"text.html.basic"
73-
],
74-
"scopeName": "inline.python-html",
75-
"path": "./syntaxes/python-inline-html.json",
76-
"embeddedLanguages": {
77-
"meta.embedded.block.html": "html"
78-
}
79-
},
80-
{
81-
"injectTo": [
82-
"source.py",
83-
"source.ts",
84-
"source.tsx",
85-
"source.sql"
86-
],
87-
"scopeName": "inline.python-sql",
88-
"path": "./syntaxes/python-inline-sql.json",
89-
"embeddedLanguages": {
90-
"meta.embedded.sql": "sql"
91-
}
16+
"contributes": {
17+
"grammars": [
18+
{
19+
"path": "./syntaxes/highlight-sql-string.json",
20+
"scopeName": "python-sql.injection",
21+
"injectTo": ["source.python"],
22+
"embeddedLanguages": {
23+
"meta.embedded.sql": "sql"
24+
}
25+
}
26+
]
9227
}
93-
]
94-
}
95-
}
28+
}

scripts/main.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

syntaxes/es6-js-injection.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

syntaxes/highlight-sql-string.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"fileTypes": [
3+
"py"
4+
],
5+
"injectionSelector": "L:string.quoted.multi",
6+
"patterns": [
7+
{
8+
"begin": "(--sql|--beginsql|--begin-sql)",
9+
"end": "(--endsql|--end-sql)",
10+
"beginCaptures": {
11+
"1": {
12+
"name": "variable.parameter"
13+
}
14+
},
15+
"patterns": [
16+
{
17+
"include": "source.ts#template-substitution-element"
18+
},
19+
{
20+
"include": "source.sql"
21+
}
22+
]
23+
}
24+
],
25+
"scopeName": "python-sql.injection"
26+
}
27+

0 commit comments

Comments
 (0)