mirror of https://github.com/helix-editor/helix
languages: create dedicated language for json-ld (#13925)
parent
16d06643a4
commit
8e0f326ebb
|
@ -120,6 +120,7 @@
|
||||||
| jq | ✓ | ✓ | | `jq-lsp` |
|
| jq | ✓ | ✓ | | `jq-lsp` |
|
||||||
| jsdoc | ✓ | | | |
|
| jsdoc | ✓ | | | |
|
||||||
| json | ✓ | ✓ | ✓ | `vscode-json-language-server` |
|
| json | ✓ | ✓ | ✓ | `vscode-json-language-server` |
|
||||||
|
| json-ld | ✓ | ✓ | ✓ | `vscode-json-language-server` |
|
||||||
| json5 | ✓ | | | |
|
| json5 | ✓ | | | |
|
||||||
| jsonc | ✓ | | ✓ | `vscode-json-language-server` |
|
| jsonc | ✓ | | ✓ | `vscode-json-language-server` |
|
||||||
| jsonnet | ✓ | | | `jsonnet-language-server` |
|
| jsonnet | ✓ | | | `jsonnet-language-server` |
|
||||||
|
|
|
@ -514,7 +514,6 @@ file-types = [
|
||||||
"css.map",
|
"css.map",
|
||||||
{ glob = ".jslintrc" },
|
{ glob = ".jslintrc" },
|
||||||
"jsonl",
|
"jsonl",
|
||||||
"jsonld",
|
|
||||||
{ glob = ".vuerc" },
|
{ glob = ".vuerc" },
|
||||||
{ glob = "composer.lock" },
|
{ glob = "composer.lock" },
|
||||||
{ glob = ".watchmanconfig" },
|
{ glob = ".watchmanconfig" },
|
||||||
|
@ -555,6 +554,17 @@ language-servers = [ "vscode-json-language-server" ]
|
||||||
auto-format = true
|
auto-format = true
|
||||||
indent = { tab-width = 2, unit = " " }
|
indent = { tab-width = 2, unit = " " }
|
||||||
|
|
||||||
|
# https://www.w3.org/TR/json-ld/
|
||||||
|
[[language]]
|
||||||
|
name = "json-ld"
|
||||||
|
scope = "source.json-ld"
|
||||||
|
injection-regex = "json-ld"
|
||||||
|
grammar = "json"
|
||||||
|
file-types = ["jsonld"]
|
||||||
|
language-servers = ["vscode-json-language-server"]
|
||||||
|
auto-format = true
|
||||||
|
indent = { tab-width = 2, unit = " " }
|
||||||
|
|
||||||
[[language]]
|
[[language]]
|
||||||
name = "json5"
|
name = "json5"
|
||||||
scope = "source.json5"
|
scope = "source.json5"
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
; inherits: json
|
||||||
|
|
||||||
|
; https://www.w3.org/TR/json-ld/#syntax-tokens-and-keywords
|
||||||
|
((string (string_content) @keyword)
|
||||||
|
(#any-of? @keyword
|
||||||
|
"@base"
|
||||||
|
"@container"
|
||||||
|
"@context"
|
||||||
|
"@direction"
|
||||||
|
"@graph"
|
||||||
|
"@id"
|
||||||
|
"@import"
|
||||||
|
"@included"
|
||||||
|
"@index"
|
||||||
|
"@json"
|
||||||
|
"@language"
|
||||||
|
"@list"
|
||||||
|
"@nest"
|
||||||
|
"@none"
|
||||||
|
"@prefix"
|
||||||
|
"@propagate"
|
||||||
|
"@protected"
|
||||||
|
"@reverse"
|
||||||
|
"@set"
|
||||||
|
"@type"
|
||||||
|
"@value"
|
||||||
|
"@version"
|
||||||
|
"@vocab"))
|
||||||
|
|
||||||
|
((pair
|
||||||
|
value: (string (string_content) @string.special.url))
|
||||||
|
(#match? @string.special.url "^https?://"))
|
||||||
|
|
||||||
|
((array
|
||||||
|
(string (string_content) @string.special.url))
|
||||||
|
(#match? @string.special.url "^https?://"))
|
||||||
|
|
||||||
|
; https://www.w3.org/TR/json-ld/#dfn-base-direction
|
||||||
|
((pair
|
||||||
|
key: (string (string_content) @keyword)
|
||||||
|
value: (string (string_content) @type.enum.variant))
|
||||||
|
(#eq? @keyword "@direction")
|
||||||
|
(#any-of? @type.enum.variant "ltr" "rtl"))
|
|
@ -0,0 +1 @@
|
||||||
|
; inherits: json
|
|
@ -0,0 +1 @@
|
||||||
|
; inherits: json
|
Loading…
Reference in New Issue