From 703c92762d6bf61d36a67d7e283c051c6db67c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Koz=C5=82owski?= Date: Tue, 24 Dec 2024 19:00:48 +0100 Subject: [PATCH] Even better --- .../playground/MultiServiceResolver.scala | 2 +- .../language/CompletionProvider.scala | 2 +- .../libtree-sitter-smithyql.dylib | Bin 34384 -> 34384 bytes .../libtree-sitter-smithyql.dylib | Bin 16456 -> 16456 bytes .../linux-aarch64/libtree-sitter-smithyql.so | Bin 67368 -> 67368 bytes .../linux-x86-64/libtree-sitter-smithyql.so | Bin 18304 -> 18304 bytes .../nodes/OperationNameQualifier.scala | 39 ------------------ .../generated/nodes/QueryOperationName.scala | 10 ++--- tree-sitter-smithyql/grammar.js | 11 ++--- 9 files changed, 13 insertions(+), 51 deletions(-) delete mode 100644 modules/treesitter/src/main/scala/playground/generated/nodes/OperationNameQualifier.scala diff --git a/modules/core/src/main/scala/playground/MultiServiceResolver.scala b/modules/core/src/main/scala/playground/MultiServiceResolver.scala index 587958e2..ff35f20f 100644 --- a/modules/core/src/main/scala/playground/MultiServiceResolver.scala +++ b/modules/core/src/main/scala/playground/MultiServiceResolver.scala @@ -60,7 +60,7 @@ object MultiServiceResolver { ): EitherNel[CompilationError, Option[QualifiedIdentifier]] = queryOperationName .name .flatTraverse { opName => - queryOperationName.identifier.flatMap(_.qualified_identifier) match { + queryOperationName.service_identifier match { case Some(explicitRef) => resolveExplicitTs(serviceIndex, explicitRef, opName) case None => resolveImplicitTs(opName, serviceIndex, useClauses).map(_.some) } diff --git a/modules/language-support/src/main/scala/playground/language/CompletionProvider.scala b/modules/language-support/src/main/scala/playground/language/CompletionProvider.scala index c2f7186f..ddf18c29 100644 --- a/modules/language-support/src/main/scala/playground/language/CompletionProvider.scala +++ b/modules/language-support/src/main/scala/playground/language/CompletionProvider.scala @@ -120,7 +120,7 @@ object CompletionProvider { // includes the current query's service reference // as it wouldn't result in ading a use clause val presentServiceIdentifiers = { - q.select(_.operation_name.identifier.qualified_identifier) ++ + q.select(_.operation_name.service_identifier) ++ sf.select(_.prelude.use_clause.identifier) }.flatMap(ASTAdapter.decodeQI) diff --git a/modules/treesitter/src/main/resources/darwin-aarch64/libtree-sitter-smithyql.dylib b/modules/treesitter/src/main/resources/darwin-aarch64/libtree-sitter-smithyql.dylib index b6e1fde7d93dda2f3e295e6318e40314d889e1e5..e9e2482ff961ac63dc630f3dde591c0baf86d40f 100755 GIT binary patch delta 3191 zcmb7G3v5$m6h8OSuHCa`jIG$D)KZP?esx$4zQ2BRb;hRthEkJmu%^rGQF7QKx$S3yhV_gjIP8~vvh7&@ z59@!vSf1128h>u>;mv{YGG(BX52<5icV~E)d!$9J`-p7ZS-4vLq=RhXl|`j$QZ7m4 zq*BOyK3JSn(2EqxBNr8rg_2-3Q3_-NWk6b}H>6XGvqt0CQ<7nd+MQ85a^myYz&1AWWXgVHGxoQY1YBFhOcJxOjTF4^@2 z$(HEC9zCl7@=2SPu?;>ys3fFKgJ>Y6M1%A~k^QA$nO@WfCzGIi%OHt{JT^v&PQ{BX zg60EjZJEdqHd8>?+>jnBfpi-gAq>()K^PROhE%B*(nLKW`$mhZGy=Mro`$sIP$Y~w z(x!?-&>op*bf0#Ng>gQkaviKH4zO!Yt));hJqt3^07y?XQ5%nO%Fp4>jPh3K5!;xk zO{E4sdmQAWjZJ{nLNDpQ?u|``RiUXNQ1{Ma3pK?pG)*ryLob#N8QWzner7aYp;r;3 z9fYxs+2T0VF0<}QuC61QizG9(>WlP%?8mi(GecdUdsUpJaU@;mrU+kGYplTuXhWN& zLi12PS%2bkqfN%*79cJWziUPNZHMqYXb))KV*;llP{9OasS9yWC>^sb!o9i60X95h zc_W&&1S`dIWm-xhZ6=XH%CrmtrZ{~CbW5CWJixK|mGCFW`QPrQukKc_4SMYNBvZTg z3R2?=tc4ysS*=$IFQj#l>3Zjywt*iEafS9G?ga2BU_(+aPzY24^}r-xHt;5}2G|H} z2g1Ms;0SOM_!YPX{0mqy-gLkP6axX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ae-55A~@L>G;{qsxVo=3UXtftidip@DHO?t JfKQht(LXDO31a{N diff --git a/modules/treesitter/src/main/resources/linux-aarch64/libtree-sitter-smithyql.so b/modules/treesitter/src/main/resources/linux-aarch64/libtree-sitter-smithyql.so index 616d0dab5339c9fc17d8482a638aed27bc06e74d..87a4d8ace6619498275c67d380076e60d72dc325 100755 GIT binary patch delta 4392 zcmb7IZEPGz8J^kQyW8`fo4eTY`o4U3{yfKxKbod-nvytFkQ%6Bt7#gj)HqJk+94Fz zM2-U$cd1a7rd4$A`@^nUAs4BVB~azcKrA7M!=D)OBd$~+e}GFs5Q$1$5CXS$FwgGJ z?w+SeC?`Gd%=^3_^Ulofc*k>>wYke$aVU7WgIT}BQ=^BXGxuy|<{q~?GgH56iw<#$%Op(&jsA$Js8_NUMZP|XpB4NQ5 zeoW#^f}f;YL4y}4T4nHybfC(h#i|Gus&u+jRnKn{4;j^^4g1C5I2$yo4jJ@VC>$$S zuzq`~ExAO;Lk3@_^PxWf9}a#JxxJ6BhU&7n(N*?OWt8-9%Z!zye}Ud;>m}&ypY*TL zZvHWKhWGMSIvw80%M0HR|2Xt?ua(uV!0bkC-6bNDu1LClka5@FFzwWpjJ0vKag#4s zB%Rm7uF|n&jCy0yyrpvHq~c1m6|RWXj&79*&h=9p;HP`KV(Jxk#Xi;S!odrjF-+ae zV|k+x80gtpXPp`c<9B&(>vSd7k=<$ex+C+Lq$lZz@l=4ZZ6;6oc$`M#+o~&S;VF7O zo@(HVeVBQ36Netd-wRH^h&T89tjatGal|u}P&s+U=G~IiG)4}2i@_V|?Rc8L7TZF5 z5*dYO=9f%kv~;OD?~;5WdZfV+VCmnevRuL07)4qz|P4?F`5178OwfV{#EvP_QX{54Ibv>FHy8(E8b4 zOUpoJStn%1j>uynee81}RJI>dV+SC8tQNA>O{%fSq5IhvAcNQxj%9XA(69;SBXiKQ zncJAFu-TdW!D`sR%{k4I@?rL6G=A0rnRNrr<*|49N%Z_kAB663hg?o$gI4rYke@B= z2w0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9~73C_;?UkocbDLRMl8TPc}A%pbHM*w9*i# zvBoj}D4ocClSZ5LD9m_9_<=CzBYtwPHN`5$>7rphL9}-f#w_{pP_e~UtK(r zZRW`rN6(E7TpD_DGg)^!-d+U;V;i|+%*($?1$vn%W+YS~J)<6tqbC0Y5} z6|-F-+ZC~_fEhlfx1JRR@0QW6%Rx3)n8HKQ3jzlm$AmZS1-(wOJ{#kgsg- zqxZHui*`c0(9`9Io?Y76rJP;5*`=CYn)OP5yB6!0dO^x@DeanTR_Y6uyug+vVV6?t zQs0yk+ts{uDedwoEp@y6>5_WClm#j65(icBgB`xGIQ{P)&gW=lr{zZ)KkDV*ojLC1 w`vT5CD>K);yfd&aqt|C{d-*TR7W4^9iR23q(r_w#1{A2glh#sB~S diff --git a/modules/treesitter/src/main/resources/linux-x86-64/libtree-sitter-smithyql.so b/modules/treesitter/src/main/resources/linux-x86-64/libtree-sitter-smithyql.so index a29d01954905dadfd37ca31d3b8b6b209587414b..1e26ac39e4de77b5fd81ee9dfd6bc6130a042be7 100755 GIT binary patch delta 5182 zcmb7IYiv}<6+UzK;a%I{bqroFu-;vJ?KL6nuEBu80v06>5EI2#S|Ftg=3#7O>KeyE zPKdZxACW_&#?AQ=8bt&tiG-pyqH;^~qiqb06eo&Q6!novfk0nzsw#y_RUJjD``vqI z?%ka2&!)Rk?$OUS-dO%X>IsDhA4hoeWjO6z&QqZ3z) zX!YD?N1MA}*1S<kh4`}0Q!9@}{I@zMUn{p;Gk(LQvPlm1y#O(o=vL{#lG>f{s^ zJ|mZ6hlWqAcKo|FypVD5y&B%z?BKl)&i#SvZ3CLmxm}LWh=wO6KCa;t91G?L@=nl{ zW-PQi_!$lVY0kmVY50u9&ue%g>-b;bo?z4@nTlGTf{bd>@R!#(QF#p?l6bp@KP$5> zX!se4?{M&PQUhP)p0a58N!i_AJ`jrXWLd;~LLviNM=!{ZMl}3oiH~deYZ9N(@JkY( z)bMv5+@y1w;XN5}Uc=jDq8Bv$_tO7$4ZkMw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_wO4y(s@X*>2mm$F?ay zuOTnj*NSr82cIB~+5Rf?b3#_$+daO_7^1^hmVgYQTnlEiwEMP1JKnR zI$QT3&!nFY0}s+;D8ty`NpXt~I4*Vvyg6{1@i}KKeu03Ya(?-CsTv{L7A97tRdJZ1`BKo38va)uy^9$j4sow>4C8X$z$v<~i$;z&_u<}qMX{H}UY=ons7HOMbDDT- zqOFOwCelotX_Uh>Q`XG*e#SKy*4$TfUEOWXWi@qWs+uFsO*I$Q+*4CcO)d2}G?{#Z z8`ktu(?v}Wud!VdLOmav@Hqqzhc%kfF@qyb*fc@YgiI4KO}I3_(tPT?To}e_8Xt5y zzkePZ(+|~+9ddH>Q{tjr*!*{^uoI8Zu33>C_XC-@vn%W!&Heb!f$$48I&bie7#Z{0CBVFMFQ@(;sY#j(+WHNVg_JOTw F@gIb=;rjpp diff --git a/modules/treesitter/src/main/scala/playground/generated/nodes/OperationNameQualifier.scala b/modules/treesitter/src/main/scala/playground/generated/nodes/OperationNameQualifier.scala deleted file mode 100644 index a193f952..00000000 --- a/modules/treesitter/src/main/scala/playground/generated/nodes/OperationNameQualifier.scala +++ /dev/null @@ -1,39 +0,0 @@ -// Generated code! Do not modify by hand. -package playground.generated.nodes - -import org.polyvariant.treesitter4s.Node -import playground.treesitter4s.std.Selection - -opaque type OperationNameQualifier <: Node = Node - -object OperationNameQualifier { - extension (node: OperationNameQualifier) { - def select[A](f: OperationNameQualifier.Selector => Selection[A]): List[A] = f(OperationNameQualifier.Selector(List(node))).path - // fields - - // typed children - def typedChildren: Option[QualifiedIdentifier] = node.children.collectFirst { - case QualifiedIdentifier(node) => node - } - // precise typed children - def qualified_identifier: Option[QualifiedIdentifier] = node.children.collectFirst { - case QualifiedIdentifier(node) => node - } - } - - def apply(node: Node): Either[String, OperationNameQualifier] = - if node.tpe == "operation_name_qualifier" - then Right(node) - else Left(s"Expected OperationNameQualifier, got ${node.tpe}") - - def unsafeApply(node: Node): OperationNameQualifier = apply(node).fold(sys.error, identity) - - def unapply(node: Node): Option[OperationNameQualifier] = apply(node).toOption - - final case class Selector(path: List[OperationNameQualifier]) extends Selection[OperationNameQualifier] { - def qualified_identifier: QualifiedIdentifier.Selector = QualifiedIdentifier.Selector(path.flatMap(_.qualified_identifier)) - - type Self = Selector - protected val remake = Selector.apply - } -} diff --git a/modules/treesitter/src/main/scala/playground/generated/nodes/QueryOperationName.scala b/modules/treesitter/src/main/scala/playground/generated/nodes/QueryOperationName.scala index cae47bc5..9480e227 100644 --- a/modules/treesitter/src/main/scala/playground/generated/nodes/QueryOperationName.scala +++ b/modules/treesitter/src/main/scala/playground/generated/nodes/QueryOperationName.scala @@ -10,13 +10,13 @@ object QueryOperationName { extension (node: QueryOperationName) { def select[A](f: QueryOperationName.Selector => Selection[A]): List[A] = f(QueryOperationName.Selector(List(node))).path // fields - def identifier: Option[OperationNameQualifier] = node.fields.getOrElse("identifier", Nil).headOption.map { - case OperationNameQualifier(node) => node - } - def name: Option[OperationName] = node.fields.getOrElse("name", Nil).headOption.map { case OperationName(node) => node } + + def service_identifier: Option[QualifiedIdentifier] = node.fields.getOrElse("service_identifier", Nil).headOption.map { + case QualifiedIdentifier(node) => node + } // typed children // precise typed children @@ -33,8 +33,8 @@ object QueryOperationName { def unapply(node: Node): Option[QueryOperationName] = apply(node).toOption final case class Selector(path: List[QueryOperationName]) extends Selection[QueryOperationName] { - def identifier: OperationNameQualifier.Selector = OperationNameQualifier.Selector(path.flatMap(_.identifier)) def name: OperationName.Selector = OperationName.Selector(path.flatMap(_.name)) + def service_identifier: QualifiedIdentifier.Selector = QualifiedIdentifier.Selector(path.flatMap(_.service_identifier)) type Self = Selector protected val remake = Selector.apply diff --git a/tree-sitter-smithyql/grammar.js b/tree-sitter-smithyql/grammar.js index c7d8e716..01ee9c70 100644 --- a/tree-sitter-smithyql/grammar.js +++ b/tree-sitter-smithyql/grammar.js @@ -47,12 +47,13 @@ module.exports = grammar({ field("selection", $.identifier) ), - operation_name_qualifier: ($) => seq($.qualified_identifier, "."), - - // todo: model as union? query_operation_name: ($) => - seq( - field("identifier", optional($.operation_name_qualifier)), + choice( + seq( + field("service_identifier", $.qualified_identifier), + ".", + field("name", $.operation_name) + ), field("name", $.operation_name) ),