aboutsummaryrefslogtreecommitdiffstats
path: root/tests/query
diff options
context:
space:
mode:
authorColin Kennedy <colinvfx@gmail.com>2023-05-06 16:00:17 -0700
committerChristian Clason <c.clason@uni-graz.at>2023-05-15 09:28:11 +0200
commit4c35c0b75d678d3f901d8dd37428ae834c4bd689 (patch)
tree2234ece53a504cb4026252e59077f1e93c16a695 /tests/query
parentUpdate parsers: dart, query (diff)
downloadnvim-treesitter-4c35c0b75d678d3f901d8dd37428ae834c4bd689.tar
nvim-treesitter-4c35c0b75d678d3f901d8dd37428ae834c4bd689.tar.gz
nvim-treesitter-4c35c0b75d678d3f901d8dd37428ae834c4bd689.tar.bz2
nvim-treesitter-4c35c0b75d678d3f901d8dd37428ae834c4bd689.tar.lz
nvim-treesitter-4c35c0b75d678d3f901d8dd37428ae834c4bd689.tar.xz
nvim-treesitter-4c35c0b75d678d3f901d8dd37428ae834c4bd689.tar.zst
nvim-treesitter-4c35c0b75d678d3f901d8dd37428ae834c4bd689.zip
Added USD as a language + some queries
Added USD highlight unittests Added USD indentation Added USD indents.scm file Added USD indent rules Simplified USD highlight groups Added explicit highlight groups Added newline Removed after/ftdetect/usda.lua usd/indents.scm - Added inline comments explaining the nodes Fixed USD highlight group unittests Added indentation unittests Simplified USD `@identifier` highlighting Added USD documentation highlight group tests Simplified USD highlight groups Moved USD `@identifier` and `@namespace` highlights into one place Removed and simplified tests/query/highlights/usd Simplified tests/query/highlights/usd more Removed trailing newline Combined USD test files Added `set filetype=usd` to minimal_init.lua
Diffstat (limited to 'tests/query')
-rw-r--r--tests/query/highlights/usd/prims.usda118
-rw-r--r--tests/query/highlights/usd/properties.usda21
-rw-r--r--tests/query/highlights/usd/subLayers.usda9
3 files changed, 148 insertions, 0 deletions
diff --git a/tests/query/highlights/usd/prims.usda b/tests/query/highlights/usd/prims.usda
new file mode 100644
index 000000000..eeac67d74
--- /dev/null
+++ b/tests/query/highlights/usd/prims.usda
@@ -0,0 +1,118 @@
+def Xform "cube" (
+ assetInfo = {
+ # <- keyword
+ asset[] payloadAssetDependencies = [@fizz.usd@, @buzz.usd@]
+ # <- type
+ # ^ keyword
+ # ^ text.uri
+ # ^ text.uri
+ }
+)
+{
+}
+
+def "root" (
+ add references = @foo.usda@</Model> (offset = 1; scale = 2.0)
+ # <- text.uri
+ # ^ string.special
+ # ^ keyword
+ # ^ number
+ # ^ punctuation.delimiter
+ # ^ keyword
+ # ^ float
+)
+{
+}
+
+def "World"
+{
+ over "points" (
+ clips = {
+ # <- keyword
+ dictionary default = {
+ # <- type
+ # ^ variable
+ double2[] times = [(101, 101), (102, 102)]
+ # <- type
+ # ^ keyword
+ # ^ number
+ }
+ }
+ )
+ {
+ }
+}
+
+def Xform "torch_2" (
+ payload = @./torch.usda@
+ kind = "model"
+)
+{
+ // Pre-published light list
+ # <- comment
+ rel lightList = [ <light> ] # inline comment
+ # ^ comment
+ token lightList:cacheBehavior = "consumeAndContinue"
+
+ double3 xformOp:translate = (1, 0, 0.5)
+ uniform token[] xformOpOrder = ["xformOp:translate"]
+}
+
+def "foo" (
+ "some comment"
+ # <- comment.documentation
+)
+{
+}
+
+def "foo" (
+ # inline comment
+ "actual in-description comment"
+ # <- comment.documentation
+)
+{
+}
+
+def "foo" (
+ add references = @foo.usda@
+ # <- function.call
+ append references = @foo.usda@
+ # <- function.call
+ delete references = @foo.usda@
+ # <- function.call
+ reorder references = [@foo.usda@]
+ # <- function.call
+
+ references = [@foo.usda@] # explicit
+)
+{
+}
+
+over "Parent" (
+ prepend references = [</InternalRef>, @./ref.usda@</RefParent>]
+ # <- function.call
+ # ^ keyword
+ # ^ string.special
+ # ^ text.uri
+ # ^ string.special
+)
+{
+}
+
+def "foo"
+{
+ float value.timeSamples = {
+ # <- type
+ # ^ variable
+ # ^ property
+ -414: 14.4
+ # <- number
+ # ^ float
+ 10: 201.0,
+ # <- number
+ # ^ float
+ 10.123: 201.0123,
+ # <- float
+ # ^ float
+ }
+}
diff --git a/tests/query/highlights/usd/properties.usda b/tests/query/highlights/usd/properties.usda
new file mode 100644
index 000000000..67df8a623
--- /dev/null
+++ b/tests/query/highlights/usd/properties.usda
@@ -0,0 +1,21 @@
+dictionary foo = {}
+# <- type
+half[] foo = [2, 1, 2]
+# <- type
+string foo = "something"
+# <- type
+timecode time = 1.0
+# <- type
+token[] purpose = ["default", "render"]
+# <- type
+
+rel material:binding:collection:Erasers = None
+# <- type
+# ^ namespace
+# ^ punctuation.delimiter
+# ^ namespace
+# ^ punctuation.delimiter
+# ^ namespace
+# ^ punctuation.delimiter
+# ^ variable
+# ^ constant.builtin
diff --git a/tests/query/highlights/usd/subLayers.usda b/tests/query/highlights/usd/subLayers.usda
new file mode 100644
index 000000000..b4dfa6298
--- /dev/null
+++ b/tests/query/highlights/usd/subLayers.usda
@@ -0,0 +1,9 @@
+#usda 1.0
+(
+ subLayers = [
+ # <- keyword
+ @./model_sub.usda@ (offset = 1)
+ # <- text.uri
+ # ^ keyword
+ ]
+)