2023-05-06 16:00:17 -07:00
|
|
|
(None) @constant.builtin
|
2024-01-06 15:05:50 +09:00
|
|
|
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
(asset_path) @string.special.url
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-05-06 16:00:17 -07:00
|
|
|
(attribute_property) @property
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-05-06 16:00:17 -07:00
|
|
|
(bool) @boolean
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-05-06 16:00:17 -07:00
|
|
|
(comment) @comment @spell
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-05-06 16:00:17 -07:00
|
|
|
(custom) @function.builtin
|
2024-01-06 15:05:50 +09:00
|
|
|
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
(float) @number.float
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-05-06 16:00:17 -07:00
|
|
|
(integer) @number
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-05-06 16:00:17 -07:00
|
|
|
(orderer) @function.call
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-05-06 16:00:17 -07:00
|
|
|
(prim_path) @string.special
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-05-06 16:00:17 -07:00
|
|
|
(relationship_type) @type
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-05-06 16:00:17 -07:00
|
|
|
(string) @string
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-05-06 16:00:17 -07:00
|
|
|
(uniform) @function.builtin
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-05-06 16:00:17 -07:00
|
|
|
(variant_set_definition) @keyword
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Prefer namespace highlighting, if any.
|
|
|
|
|
;
|
|
|
|
|
; e.g. `rel fizz` - `fizz` uses `@identifier`
|
|
|
|
|
; e.g. `rel foo:bar:fizz` - `foo` and `bar` use `@module` and `fizz` uses `@identifier`
|
|
|
|
|
;
|
2023-05-06 16:00:17 -07:00
|
|
|
(identifier) @variable
|
2024-01-06 15:05:50 +09:00
|
|
|
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
(namespace_identifier) @module
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-05-06 16:00:17 -07:00
|
|
|
(namespace_identifier
|
2024-01-06 15:05:50 +09:00
|
|
|
(identifier) @module)
|
2023-05-06 16:00:17 -07:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"def"
|
|
|
|
|
"over"
|
|
|
|
|
] @keyword.function
|
|
|
|
|
|
2024-04-23 12:23:15 -07:00
|
|
|
"class" @keyword.type
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
"{"
|
|
|
|
|
"}"
|
2026-01-07 22:05:52 -08:00
|
|
|
"[]"
|
2024-01-06 15:05:50 +09:00
|
|
|
] @punctuation.bracket
|
2023-05-06 16:00:17 -07:00
|
|
|
|
|
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
":"
|
|
|
|
|
";"
|
|
|
|
|
"."
|
2026-01-07 22:05:52 -08:00
|
|
|
","
|
2024-01-06 15:05:50 +09:00
|
|
|
] @punctuation.delimiter
|
|
|
|
|
|
|
|
|
|
"=" @operator
|
2023-05-06 16:00:17 -07:00
|
|
|
|
|
|
|
|
(attribute_type) @type
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
((attribute_type) @type.builtin
|
2024-01-05 03:19:54 +09:00
|
|
|
;format-ignore
|
|
|
|
|
(#any-of? @type.builtin
|
|
|
|
|
;; Reference: https://openusd.org/release/api/sdf_page_front.html
|
|
|
|
|
;; Scalar types
|
|
|
|
|
"asset" "asset[]"
|
|
|
|
|
"bool" "bool[]"
|
|
|
|
|
"double" "double[]"
|
|
|
|
|
"float" "float[]"
|
|
|
|
|
"half" "half[]"
|
|
|
|
|
"int" "int[]"
|
|
|
|
|
"int64" "int64[]"
|
|
|
|
|
"string" "string[]"
|
|
|
|
|
"timecode" "timecode[]"
|
|
|
|
|
"token" "token[]"
|
|
|
|
|
"uchar" "uchar[]"
|
|
|
|
|
"uint" "uint[]"
|
|
|
|
|
"uint64" "uint64[]"
|
|
|
|
|
|
|
|
|
|
;; Dimensioned Types
|
|
|
|
|
"double2" "double2[]"
|
|
|
|
|
"double3" "double3[]"
|
|
|
|
|
"double4" "double4[]"
|
|
|
|
|
"float2" "float2[]"
|
|
|
|
|
"float3" "float3[]"
|
|
|
|
|
"float4" "float4[]"
|
|
|
|
|
"half2" "half2[]"
|
|
|
|
|
"half3" "half3[]"
|
|
|
|
|
"half4" "half4[]"
|
|
|
|
|
"int2" "int2[]"
|
|
|
|
|
"int3" "int3[]"
|
|
|
|
|
"int4" "int4[]"
|
|
|
|
|
"matrix2d" "matrix2d[]"
|
|
|
|
|
"matrix3d" "matrix3d[]"
|
|
|
|
|
"matrix4d" "matrix4d[]"
|
|
|
|
|
"quatd" "quatd[]"
|
|
|
|
|
"quatf" "quatf[]"
|
|
|
|
|
"quath" "quath[]"
|
|
|
|
|
|
|
|
|
|
;; Extra Types
|
|
|
|
|
"color3f" "color3f[]"
|
|
|
|
|
"normal3f" "normal3f[]"
|
|
|
|
|
"point3f" "point3f[]"
|
|
|
|
|
"texCoord2f" "texCoord2f[]"
|
|
|
|
|
"vector3d" "vector3d[]"
|
|
|
|
|
"vector3f" "vector3f[]"
|
|
|
|
|
"vector3h" "vector3h[]"
|
|
|
|
|
|
|
|
|
|
"dictionary"
|
|
|
|
|
|
|
|
|
|
;; Deprecated Types
|
|
|
|
|
"EdgeIndex" "EdgeIndex[]"
|
|
|
|
|
"FaceIndex" "FaceIndex[]"
|
|
|
|
|
"Matrix4d" "Matrix4d[]"
|
|
|
|
|
"PointIndex" "PointIndex[]"
|
|
|
|
|
"PointFloat" "PointFloat[]"
|
|
|
|
|
"Transform" "Transform[]"
|
|
|
|
|
"Vec3f" "Vec3f[]"))
|
2023-05-06 16:00:17 -07:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
((identifier) @keyword
|
2024-01-05 03:19:54 +09:00
|
|
|
(#any-of? @keyword
|
|
|
|
|
; Reference: https://openusd.org/release/api/sdf_page_front.html
|
|
|
|
|
; LIVRPS names
|
2024-02-23 17:42:01 +09:00
|
|
|
"inherits" "payload" "references" "specializes" "variantSets" "variants"
|
2024-01-05 03:19:54 +09:00
|
|
|
; assetInfo names
|
2024-02-23 17:42:01 +09:00
|
|
|
"assetInfo" "identifier" "name" "payloadAssetDependencies" "version"
|
2024-01-05 03:19:54 +09:00
|
|
|
; clips names
|
2024-02-23 17:42:01 +09:00
|
|
|
"clips" "active" "assetPaths" "manifestAssetPath" "primPath" "templateAssetPath"
|
|
|
|
|
"templateEndTime" "templateStartTime" "templateStride" "times"
|
2024-01-05 03:19:54 +09:00
|
|
|
; customData names
|
2024-02-23 17:42:01 +09:00
|
|
|
"customData" "apiSchemaAutoApplyTo" "apiSchemaOverridePropertyNames" "className" "extraPlugInfo"
|
|
|
|
|
"isUsdShadeContainer" "libraryName" "providesUsdShadeConnectableAPIBehavior"
|
|
|
|
|
"requiresUsdShadeEncapsulation" "skipCodeGeneration"
|
2024-01-05 03:19:54 +09:00
|
|
|
; Layer metadata names
|
2024-02-23 17:42:01 +09:00
|
|
|
"colorConfiguration" "colorManagementSystem" "customLayerData" "defaultPrim" "doc" "endTimeCode"
|
|
|
|
|
"framesPerSecond" "owner" "startTimeCode" "subLayers"
|
2024-01-05 03:19:54 +09:00
|
|
|
; Prim metadata
|
|
|
|
|
"instanceable"))
|
2023-05-06 16:00:17 -07:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Common attribute metadata
|
2024-01-21 22:05:44 +09:00
|
|
|
(layer_offset
|
2023-05-06 16:00:17 -07:00
|
|
|
(identifier) @keyword
|
2024-01-21 22:05:44 +09:00
|
|
|
(#any-of? @keyword "offset" "scale"))
|
2023-05-06 16:00:17 -07:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Docstrings in USD
|
2023-05-06 16:00:17 -07:00
|
|
|
(metadata
|
2024-01-06 15:05:50 +09:00
|
|
|
(comment)*
|
|
|
|
|
(string) @comment.documentation)
|