Skip to content

Commit

Permalink
Even better
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Dec 24, 2024
1 parent 4408463 commit 703c927
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions tree-sitter-smithyql/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
),

Expand Down

0 comments on commit 703c927

Please sign in to comment.