Skip to content

Commit

Permalink
Union template declaration were being finished in projector (#3052)
Browse files Browse the repository at this point in the history
fix [#2946](#2946)

Problem was that in the projector were were calling to this helper to
see if that was a type that we should finish but it was missing the
union case causing union template declaration from being finished in the
projector and then being shown as finished type in the semantic
navigator and crashing openapi3 emitter.
  • Loading branch information
timotheeguerin authored Mar 28, 2024
1 parent e31309e commit 85fa7ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .chronus/changes/fix-union-template-2024-2-26-16-22-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- "@typespec/compiler"
---

Fix: Union template declaration were incorrectly being finished in projection
1 change: 1 addition & 0 deletions packages/compiler/src/core/type-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function getParentTemplateNode(node: Node): (Node & TemplateDeclarationNo
case SyntaxKind.ModelStatement:
case SyntaxKind.ScalarStatement:
case SyntaxKind.OperationStatement:
case SyntaxKind.UnionStatement:
case SyntaxKind.InterfaceStatement:
return node.templateParameters.length > 0 ? node : undefined;
case SyntaxKind.OperationSignatureDeclaration:
Expand Down

0 comments on commit 85fa7ae

Please sign in to comment.