first attempt at vscode syntax highlighting

This commit is contained in:
adam j hartz 2025-09-27 19:54:27 -04:00
commit 67f3f99379
Signed by: hz
GPG key ID: B63A0A59F5C82493
9 changed files with 273 additions and 1 deletions

View file

@ -3,7 +3,7 @@ recursive-include catsoop/__HANDLERS__ *
recursive-include catsoop/__QTYPES__ *
recursive-include catsoop/__STATIC__ *
recursive-include catsoop/__UTIL__ *
recursive-include vim *
recursive-include syntax-highlighting *
recursive-include systemd *
include README
include LICENSE

View file

@ -0,0 +1 @@
../../LICENSE

View file

@ -0,0 +1,9 @@
to build, use:
npm install -g @vscode/vsce
vsce package
or download from:
https://catsoop.org/_static/catsoop-syntax-0.0.1.vsix
to install, run:
code --install-extension catsoop-syntax-0.0.1.vsix

View file

@ -0,0 +1,78 @@
{
"comments": {
"blockComment": [
"<comment>",
"</comment>"
]
},
"brackets": [
[
"{",
"}"
],
[
"[",
"]"
],
[
"(",
")"
],
[
"<",
">"
]
],
"autoClosingPairs": [
{
"open": "{",
"close": "}"
},
{
"open": "[",
"close": "]"
},
{
"open": "(",
"close": ")"
},
{
"open": "\"",
"close": "\""
},
{
"open": "'",
"close": "'"
},
{
"open": "`",
"close": "`"
}
],
"surroundingPairs": [
[
"{",
"}"
],
[
"[",
"]"
],
[
"(",
")"
],
[
"\"",
"\""
],
[
"'",
"'"
],
[
"`",
"`"
]
]
}

View file

@ -0,0 +1,31 @@
{
"name": "catsoop-syntax",
"displayName": "CAT-SOOP",
"description": "Syntax highlighting for .catsoop files",
"version": "0.0.1",
"engines": {
"vscode": "^1.0.0"
},
"categories": [
"Programming Languages"
],
"contributes": {
"languages": [
{
"id": "catsoop",
"extensions": [
".catsoop"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "catsoop",
"scopeName": "text.html.markdown.catsoop",
"path": "./syntaxes/catsoop.tmLanguage.json"
}
]
},
"repository": "https://catsoop.org/git/catsoop/catsoop"
}

View file

@ -0,0 +1,153 @@
{
"name": "CAT-SOOP",
"scopeName": "text.html.markdown.catsoop",
"patterns": [
{
"include": "#catsoop-comments"
},
{
"include": "#python-blocks"
},
{
"include": "#question-blocks"
},
{
"include": "#python-inline"
},
{
"include": "#latex-display-math"
},
{
"include": "text.html.markdown"
}
],
"repository": {
"catsoop-comments": {
"name": "comment.block.catsoop",
"begin": "<comment>",
"end": "</comment>",
"beginCaptures": {
"0": {
"name": "comment.block.catsoop"
}
},
"endCaptures": {
"0": {
"name": "comment.block.catsoop"
}
}
},
"python-blocks": {
"name": "meta.embedded.block.python.catsoop",
"begin": "(<)(python)(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.html"
},
"3": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(</)(python)(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.html"
},
"3": {
"name": "punctuation.definition.tag.end.html"
}
},
"patterns": [
{
"include": "source.python"
}
]
},
"question-blocks": {
"name": "meta.embedded.block.python.question.catsoop",
"begin": "(<)(question)\\s+([^>]*)(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.html"
},
"3": {
"name": "string.unquoted.html.attribute.catsoop",
"patterns": [
{
"include": "text.html.basic#attribute"
}
]
},
"4": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(</)(question)(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.html"
},
"3": {
"name": "punctuation.definition.tag.end.html"
}
},
"patterns": [
{
"include": "source.python"
}
]
},
"python-inline": {
"name": "meta.embedded.inline.python.catsoop",
"begin": "@\\{",
"beginCaptures": {
"0": {
"name": "punctuation.section.embedded.begin.catsoop"
}
},
"end": "\\}",
"endCaptures": {
"0": {
"name": "punctuation.section.embedded.end.catsoop"
}
},
"patterns": [
{
"include": "source.python"
}
]
},
"latex-display-math": {
"name": "meta.embedded.block.latex.math.catsoop",
"begin": "\\$\\$",
"beginCaptures": {
"0": {
"name": "punctuation.definition.math.begin.latex"
}
},
"end": "\\$\\$",
"endCaptures": {
"0": {
"name": "punctuation.definition.math.end.latex"
}
},
"patterns": [
{
"include": "text.tex.latex#math"
}
]
}
}
}

Binary file not shown.