Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix semantic walker not firing exitOperation or exitModelProperty #4381

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

AlitzelMendez
Copy link
Contributor

Fix: #4379

@AlitzelMendez AlitzelMendez self-assigned this Sep 10, 2024
@AlitzelMendez AlitzelMendez added the bug Something isn't working label Sep 10, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the compiler:core Issues for @typespec/compiler label Sep 10, 2024
@azure-sdk
Copy link
Collaborator

azure-sdk commented Sep 10, 2024

All changed packages have been documented.

  • @typespec/compiler
Show changes

@typespec/compiler - fix ✏️

Fix Semantic walker doesn't fire exitOperation or exitModelProperty

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

@AlitzelMendez AlitzelMendez added this pull request to the merge queue Sep 10, 2024
Merged via the queue into main with commit 5a55338 Sep 10, 2024
22 checks passed
@AlitzelMendez AlitzelMendez deleted the almend/SemanticWalkerExit branch September 10, 2024 04:28
@@ -229,6 +229,7 @@ function navigateOperationType(operation: Operation, context: NavigationContext)
if (operation.sourceOperation) {
navigateTypeInternal(operation.sourceOperation, context);
}
context.emit("exitOperation", operation);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late comment - but I think the exit methods still won't be executed if the pre-order callback sets no recursion. Maybe not a real issue if it's unlikely someone would use both pre and post-order callbacks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I thought that was the expected behavior, but makes sense, I will follow up on this

namespaces: [] as Namespace[],
operations: [] as Operation[],
exitOperations: [] as Operation[],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason not to extend the post-order callbacks to every type? Looks like we might still be missing some like namespaces, interfaces, etc.

sarangan12 pushed a commit to sarangan12/typespec that referenced this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler:core Issues for @typespec/compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Semantic walker doesn't fire exitOperation or exitModelProperty
4 participants