From 979c32493d1edabb949badf00da9d130d966aaae Mon Sep 17 00:00:00 2001 From: Jirgn Date: Fri, 26 Nov 2021 16:37:51 +0100 Subject: feat: add fusion grammar and highlights --- tests/query/highlights/fusion/basic.fusion | 61 +++++++++++++++++++ tests/query/highlights/fusion/expressions.fusion | 74 ++++++++++++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 tests/query/highlights/fusion/basic.fusion create mode 100644 tests/query/highlights/fusion/expressions.fusion (limited to 'tests/query') diff --git a/tests/query/highlights/fusion/basic.fusion b/tests/query/highlights/fusion/basic.fusion new file mode 100644 index 000000000..7149956a1 --- /dev/null +++ b/tests/query/highlights/fusion/basic.fusion @@ -0,0 +1,61 @@ +include: SomeFile.fusion +//<- include +// ^punctation.delimiter +// ^uri + +namespace ns = Neos.Fusion.Space +//<- keyword +// ^namespace +// ^operator +// ^namespace + +prototype(MyType) < prototype(ns:SuperType) { +//<-keyword +// ^punctation.bracket +// ^type +// ^punctation.bracket +// ^operator +// ^namespace +// ^type + + deleteProp > + // ^operator + + string = 'value' + //<- property + // ^operator + // ^string + + number = 10.2 + // ^number + + null = null + // ^constant.builtin + + boolean = true + // ^boolean + + property.inner = "value" + //<- property + // ^property + + property.@meta = "value" + //<- property + // ^attribute + + property.type = SomeType + //<- property + // ^type + + property.aliasedType = ns:SomeType + //<- property + // ^namespace + // ^type + + property.fullQualifiedType = SomeNamespace:SomeType + //<- property + // ^namespace + // ^type + +} + diff --git a/tests/query/highlights/fusion/expressions.fusion b/tests/query/highlights/fusion/expressions.fusion new file mode 100644 index 000000000..db71a628a --- /dev/null +++ b/tests/query/highlights/fusion/expressions.fusion @@ -0,0 +1,74 @@ +string = ${'foo'} +// ^string + +string = ${'foo \'bar\' baz'} +// ^string + +string = ${"foo"} +// ^string + +string = ${"foo ${test}"} +// ^string + +boolean = ${true} +// ^boolean + +number = ${1} +// ^number + +number = ${1.2} +// ^number + +propertyPath = ${property.path} +// ^variable +// ^variable + +array = ${[]} +// ^punctation.bracket + +array = ${[true, 'string', 1, [true]]} +// ^punctation.bracket +// ^boolean +// ^string +// ^number +// ^punctation.bracket +// ^boolean + +object = ${{}} +// ^punctation.bracket + +object = ${{first: 'value', second: true, third: [], fourth: object.path }} +// ^property +// ^string +// ^property +// ^boolean +// ^property +// ^punctation.bracket +// ^property +// ^variable + +result = ${methodCall()} +// ^function + +result = ${Some.methodCall(param, param)} +// ^function +// ^variable +// ^variable + +arrowFunction = ${map(foo, (bar, buz) => bar * buz)} +// ^function +// ^variable +// ^variable + +logic = ${!foo && !(bar || baz) and not 'string'} +// ^operator +// ^operator +// ^operator +// ^operator +// ^operator + +ternary = ${ check ? true : false} +// ^punctation.delimiter +// ^punctation.delimiter + + -- cgit v1.2.3-70-g09d2