Skip to content

Commit

Permalink
editor-plugins: add hashbang line highlighting
Browse files Browse the repository at this point in the history
This adds supports for highlighting an hashbang line as a comment, in
vscode and in highlight.js.
  • Loading branch information
lucab committed Oct 20, 2024
1 parent e2e476c commit 8fea446
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated
### Removed
### Fixed

- Hashbang lines are now properly highlighted as comments in vscode and in highlight.js.

### Security

## v0.22.2 -- 2024-10-08
Expand Down
1 change: 1 addition & 0 deletions editor-plugins/highlight.js/quint.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function quintHljs(hljs) {
scope: 'number',
begin: '-?(0x[0-9a-fA-F]([0-9a-fA-F]|_[0-9a-fA-F])*|0|[1-9]([0-9]|_[0-9])*)',
},
hljs.SHEBANG, // file-leading hashbang
hljs.C_LINE_COMMENT_MODE, // single line comments
hljs.C_BLOCK_COMMENT_MODE, // multiline comments
],
Expand Down
11 changes: 11 additions & 0 deletions vscode/quint-vscode/syntaxes/quint.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Quint",
"patterns": [
{
"include": "#hashbangLine"
},
{
"include": "#lineComments"
},
Expand Down Expand Up @@ -92,6 +95,14 @@
}
]
},
"hashbangLine": {
"patterns": [
{
"name": "comment.line.hashbang.quint",
"match": "^#!.*$"
}
]
},
"lineComments": {
"patterns": [
{
Expand Down

0 comments on commit 8fea446

Please sign in to comment.