Skip to content

Commit

Permalink
Merge branch 'master' into non-root
Browse files Browse the repository at this point in the history
  • Loading branch information
PranayAgarwal authored Jul 15, 2020
2 parents 390587b + 273a6fe commit 2295ee9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@
"language": "hack",
"scopeName": "source.hack",
"path": "./syntaxes/hack.json"
},
{
"scopeName": "markdown.hack.codeblock",
"path": "./syntaxes/codeblock.json",
"injectTo": [
"text.html.markdown"
],
"embeddedLanguages": {
"meta.embedded.block.hack": "hack"
}
}
],
"snippets": [
Expand Down
22 changes: 22 additions & 0 deletions syntaxes/codeblock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"fileTypes": [],
"injectionSelector": "L:markup.fenced_code.block.markdown",
"patterns": [
{
"include": "#hack-code-block"
}
],
"repository": {
"hack-code-block": {
"begin": "hack",
"end": "(^|\\G)(?=\\s*[`~]{3,}\\s*$)",
"contentName": "meta.embedded.block.hack",
"patterns": [
{
"include": "source.hack"
}
]
}
},
"scopeName": "markdown.hack.codeblock"
}
7 changes: 7 additions & 0 deletions syntaxes/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ This folder contains interesting examples of hack code that can be used to demon
To report a bug for syntax highlighting, please submit a file that demonstrates a snippet of code that is colored incorrectly.

To test updates to syntax coloring, open this folder and verify the examples.

```hack
// This embedded code block within the markdown should also be properly highlighted in the manner of a hack file.
function f() {
return;
}
```

0 comments on commit 2295ee9

Please sign in to comment.