mirror of
https://github.com/ziex-dev/ziex.git
synced 2026-07-20 02:29:36 -06:00
fix(ide): vscode syntax improvements
This commit is contained in:
parent
51118f45a4
commit
b64c741ad0
4
ide/vscode/package-lock.json
generated
4
ide/vscode/package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "ziex",
|
||||
"version": "0.1.678",
|
||||
"version": "0.1.1140",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ziex",
|
||||
"version": "0.1.678",
|
||||
"version": "0.1.1140",
|
||||
"dependencies": {
|
||||
"vscode-html-languageservice": "^5.6.0",
|
||||
"vscode-languageclient": "^9.0.1"
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
"injectionSelector": "L:(source.zig, source.zx) - string - comment",
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "SQL injection for db/database run/query/exec/prepare",
|
||||
"begin": "((?:db|database)\\.(?:run|query|exec|prepare))\\s*\\(",
|
||||
"comment": "SQL injection for db/database query-taking methods (optionally namespaced, e.g. zx.db.run). The first string literal inside the call is the SQL — no preceding argument (allocator, comptime type) is a string, so matching the first string is safe for prepare/run (1st arg), get/all (2nd arg), and row/rows (3rd arg).",
|
||||
"begin": "((?:\\b[a-zA-Z_][a-zA-Z0-9_]*\\.)?(?:db|database)\\.(?:prepare|run|get|all|row|rows))\\s*\\(",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "support.function.zig"
|
||||
|
||||
@ -4,6 +4,9 @@
|
||||
"scopeName": "source.zx",
|
||||
"fileTypes": ["zx", "zx"],
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#zig-guards"
|
||||
},
|
||||
{
|
||||
"include": "#zx"
|
||||
},
|
||||
@ -12,6 +15,40 @@
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"zig-guards": {
|
||||
"comment": "Match Zig comments and string literals before #zx so a '<' inside them is never treated as the start of a zx tag (which would otherwise swallow the rest of the file).",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "comment.line.documentation.zig",
|
||||
"match": "//[!/].*$"
|
||||
},
|
||||
{
|
||||
"name": "comment.line.double-slash.zig",
|
||||
"match": "//.*$"
|
||||
},
|
||||
{
|
||||
"name": "string.quoted.double.zig",
|
||||
"begin": "\"",
|
||||
"end": "\"|(?<!\\\\)(?=$)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.zig#stringcontent"
|
||||
},
|
||||
{
|
||||
"match": "\\\\."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "string.quoted.single.zig",
|
||||
"match": "'(\\\\.|[^'\\\\])'"
|
||||
},
|
||||
{
|
||||
"name": "string.quoted.other.multiline.zig",
|
||||
"match": "^\\s*\\\\\\\\.*$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"zx": {
|
||||
"patterns": [
|
||||
{
|
||||
@ -291,6 +328,9 @@
|
||||
{
|
||||
"include": "#zig-multiline-string"
|
||||
},
|
||||
{
|
||||
"include": "#zig-guards"
|
||||
},
|
||||
{
|
||||
"include": "#zx"
|
||||
},
|
||||
@ -343,6 +383,9 @@
|
||||
{
|
||||
"include": "#zig-multiline-string"
|
||||
},
|
||||
{
|
||||
"include": "#zig-guards"
|
||||
},
|
||||
{
|
||||
"include": "#zx"
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user