aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-06-28 23:54:10 +0200
committerDanielGavin <danielgavin5@hotmail.com>2024-06-28 23:54:10 +0200
commit28f666c77352734ee720b3b56e34f7261d3a86b2 (patch)
treeb90802760959cae5d80004a874d3df5011a6c2f6 /editors
parentf2dd4753508299f86490c083cf4eaad0c8ab7b1e (diff)
parent9fc36bfa5c76bec6f890d744398169a8069ada5a (diff)
Merge branch 'master' into rename
Diffstat (limited to 'editors')
-rw-r--r--editors/vscode/package-lock.json4
-rw-r--r--editors/vscode/package.json12
-rw-r--r--editors/vscode/syntaxes/codeblock.json45
-rw-r--r--editors/vscode/syntaxes/odin.tmLanguage.json121
4 files changed, 112 insertions, 70 deletions
diff --git a/editors/vscode/package-lock.json b/editors/vscode/package-lock.json
index 26b64a9..2384838 100644
--- a/editors/vscode/package-lock.json
+++ b/editors/vscode/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "ols",
- "version": "0.1.27",
+ "version": "0.1.30",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ols",
- "version": "0.1.27",
+ "version": "0.1.30",
"dependencies": {
"adm-zip": "^0.5.9",
"https-proxy-agent": "^5.0.0",
diff --git a/editors/vscode/package.json b/editors/vscode/package.json
index 021a214..e7d0003 100644
--- a/editors/vscode/package.json
+++ b/editors/vscode/package.json
@@ -7,7 +7,7 @@
"type": "git",
"url": "git://github.com/DanielGavin/ols.git"
},
- "version": "0.1.29",
+ "version": "0.1.30",
"engines": {
"vscode": "^1.66.0"
},
@@ -114,6 +114,16 @@
"language": "odin",
"scopeName": "source.odin",
"path": "./syntaxes/odin.tmLanguage.json"
+ },
+ {
+ "scopeName": "markdown.odin.codeblock",
+ "path": "./syntaxes/codeblock.json",
+ "injectTo": [
+ "text.html.markdown"
+ ],
+ "embeddedLanguages": {
+ "meta.embedded.block.odin": "odin"
+ }
}
],
"breakpoints": [
diff --git a/editors/vscode/syntaxes/codeblock.json b/editors/vscode/syntaxes/codeblock.json
new file mode 100644
index 0000000..0f3ee2e
--- /dev/null
+++ b/editors/vscode/syntaxes/codeblock.json
@@ -0,0 +1,45 @@
+{
+ "comment": "Taken from https://github.com/microsoft/vscode/blob/main/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json",
+ "injectionSelector": "L:text.html.markdown",
+ "patterns": [
+ {
+ "include": "#fenced_code_block_odin"
+ }
+ ],
+ "repository": {
+ "fenced_code_block_odin": {
+ "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(odin)((\\s+|:|,|\\{|\\?)[^`]*)?$)",
+ "name": "markup.fenced_code.block.markdown",
+ "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
+ "beginCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ },
+ "4": {
+ "name": "fenced_code.block.language.markdown"
+ },
+ "5": {
+ "name": "fenced_code.block.language.attributes.markdown"
+ }
+ },
+ "endCaptures": {
+ "3": {
+ "name": "punctuation.definition.markdown"
+ }
+ },
+ "patterns": [
+ {
+ "begin": "(^|\\G)(\\s*)(.*)",
+ "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
+ "contentName": "meta.embedded.block.odin",
+ "patterns": [
+ {
+ "include": "source.odin"
+ }
+ ]
+ }
+ ]
+ }
+ },
+ "scopeName": "markdown.odin.codeblock"
+}
diff --git a/editors/vscode/syntaxes/odin.tmLanguage.json b/editors/vscode/syntaxes/odin.tmLanguage.json
index d9349b9..6f44764 100644
--- a/editors/vscode/syntaxes/odin.tmLanguage.json
+++ b/editors/vscode/syntaxes/odin.tmLanguage.json
@@ -284,8 +284,8 @@
},
"case-clause": {
"name": "meta.case-clause.expr.odin",
- "begin": "case",
- "beginCaptures": { "0": { "name": "keyword.control.case.odin" } },
+ "begin": "\\b(case)\\b",
+ "beginCaptures": { "1": { "name": "keyword.control.case.odin" } },
"end": ":",
"endCaptures": { "0": { "name": "punctuation.definition.section.case-statement.odin" } },
"patterns": [ { "include": "#expressions" } ]
@@ -359,27 +359,22 @@
{
"name": "comment.line.double-slash.odin",
"begin": "//",
+ "beginCaptures": {"0": {"name": "punctuation.definition.comment.odin"}},
"end": "\n"
}
]
},
"block-comment": {
- "patterns": [
- {
- "name": "comment.block.odin",
- "begin": "/\\*",
- "end": "\\*/",
- "patterns": [ { "include": "#block-comment" } ]
- }
- ]
+ "name": "comment.block.odin",
+ "begin": "/\\*",
+ "beginCaptures": {"0": {"name": "punctuation.definition.comment.begin.odin"}},
+ "end": "\\*/",
+ "endCaptures": {"0": {"name": "punctuation.definition.comment.end.odin"}},
+ "patterns": [ { "include": "#block-comment" } ]
},
"type-name": {
- "patterns": [
- {
- "name": "entity.name.type.odin",
- "match": "\\b[A-Za-z_]\\w*\\b"
- }
- ]
+ "name": "entity.name.type.odin",
+ "match": "\\b[A-Za-z_]\\w*\\b"
},
"type-parameter": {
"captures": {
@@ -389,21 +384,12 @@
"match": "(\\$)\\s*(\\b[A-Za-z_]\\w*\\b)"
},
"variable-name": {
- "patterns": [
- {
- "name": "variable.name.odin",
- "match": "\\b[A-Za-z_]\\w*\\b"
- }
- ]
+ "name": "variable.name.odin",
+ "match": "\\b[A-Za-z_]\\w*\\b"
},
"keywords": {
"patterns": [
{
- "name": "keyword.tag.odin",
- "comment": "Use #name to use a pattern",
- "match": "\\b([#@]\\s*[A-Za-z_]\\w*)\\b"
- },
- {
"name": "keyword.control.odin",
"match": "\\b(import|foreign|package)\\b"
},
@@ -435,7 +421,7 @@
"match": "\\b(auto_cast|distinct|using)\\b"
},
{
- "name": "variable.other.object.odin",
+ "name": "keyword.context.odin",
"match": "\\b(context)\\b"
},
{
@@ -463,28 +449,36 @@
"match": "\\b(struct|enum|union|map|bit_set|bit_field|matrix)\\b"
},
{
- "name": "keyword.operator.assignment.compound",
+ "name": "keyword.operator.assignment.compound.odin",
"match": "[+\\-*/%]=|%%="
},
{
- "name": "keyword.operator.assignment.compound.bitwise",
+ "name": "keyword.operator.assignment.compound.bitwise.odin",
"match": "\\|=|~=|&~?=|<<=|>>="
},
{
- "name": "keyword.operator.comparison",
+ "name": "keyword.operator.comparison.odin",
"match": "==|!="
},
{
- "name": "keyword.operator.relational",
+ "name": "keyword.operator.relational.odin",
"match": "[<>]=?"
},
{
+ "name": "keyword.operator.range.odin",
+ "match": "\\.\\.[<=]"
+ },
+ {
+ "name": "keyword.operator.spread.odin",
+ "match": "\\.\\."
+ },
+ {
"name": "keyword.operator.assignment.odin",
"match": ":[:=]|="
},
{
"name": "keyword.operator.address.odin",
- "match": "\\&"
+ "match": "&"
},
{
"name": "keyword.operator.address.odin",
@@ -500,10 +494,10 @@
},
{
"name": "keyword.operator.odin",
- "match": "@|(\\||\\!|:|\\+|-|\\*|/|%|\\<\\<?|\\>\\>?|\\~)=?|=|: : ?|\\.\\.|\\$"
+ "match": "@|(\\||\\!|:|\\+|-|\\*|/|%|\\<\\<?|\\>\\>?|\\~)=?|=|: : ?|\\$"
},
{
- "name": "keyword.other.odin",
+ "name": "entity.name.tag.odin",
"match": "#[A-Za-z_]\\w*"
}
]
@@ -570,34 +564,31 @@
},
"strings": {
"patterns": [
- { "include": "#strings-quoted-double" },
- { "include": "#strings-quoted-single" },
- { "include": "#strings-quoted-raw" }
+ {
+ "name": "string.quoted.double.odin",
+ "begin": "\"",
+ "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.odin" } },
+ "end": "\"",
+ "endCaptures": { "0": { "name": "punctuation.definition.string.end.odin" } },
+ "patterns": [ { "include": "#string-escaped-char" } ]
+ },
+ {
+ "name": "string.quoted.single.odin",
+ "begin": "'",
+ "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.odin" } },
+ "end": "'",
+ "endCaptures": { "0": { "name": "punctuation.definition.string.end.odin" } },
+ "patterns": [ { "include": "#string-escaped-char" } ]
+ },
+ {
+ "name": "string.quoted.raw.odin",
+ "begin": "`",
+ "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.odin" } },
+ "end": "`",
+ "endCaptures": { "0": { "name": "punctuation.definition.string.end.odin" } }
+ }
]
},
- "strings-quoted-double": {
- "name": "string.quoted.double.odin",
- "begin": "\"",
- "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.odin" } },
- "end": "\"",
- "endCaptures": { "0": { "name": "punctuation.definition.string.end.odin" } },
- "patterns": [ { "include": "#string-escaped-char" } ]
- },
- "strings-quoted-single": {
- "name": "string.quoted.single.odin",
- "begin": "'",
- "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.odin" } },
- "end": "'",
- "endCaptures": { "0": { "name": "punctuation.definition.string.end.odin" } },
- "patterns": [ { "include": "#string-escaped-char" } ]
- },
- "strings-quoted-raw": {
- "name": "string.quoted.raw.odin",
- "begin": "`",
- "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.odin" } },
- "end": "`",
- "endCaptures": { "0": { "name": "punctuation.definition.string.end.odin" } }
- },
"string-escaped-char": {
"patterns": [
{
@@ -615,12 +606,8 @@
]
},
"punctuation": {
- "patterns": [
- {
- "name": "punctuation.odin",
- "match": "\\(|\\)|\\{|\\}|;|\\[|\\]|\\.|,"
- }
- ]
+ "name": "punctuation.odin",
+ "match": "\\(|\\)|\\{|\\}|;|\\[|\\]|\\.|,|\\\\"
}
},
"scopeName": "source.odin"