Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Conversation

Lexxxzy
Copy link

@Lexxxzy Lexxxzy commented Sep 5, 2025

Address #499

@Copilot Copilot AI review requested due to automatic review settings September 5, 2025 19:53
@Lexxxzy Lexxxzy requested review from a team as code owners September 5, 2025 19:53
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses scope propagation issues in JavaScript switch statements by ensuring that variable references in case values can properly access variables from outer scopes. The fix modifies the tree-sitter stack graph rules to properly handle scope flow through case values when they contain no statements.

  • Fixed scope propagation for empty switch cases to flow through case values
  • Updated test expectations to reflect improved variable resolution

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/stack-graphs.tsg Modified switch case handling to properly propagate scope through case values when no statements are present
test/statements/switch_statement.js Added test cases for empty switch cases and updated expected variable definition locations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

if (is-empty @stmts) {
edge @switch_case.after_scope -> @switch_case.before_scope
; scopes flow into the value and then directly out of the case
Copy link
Preview

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

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

The comment uses a semicolon instead of the proper comment syntax. Should use '//' for comments in TSG files.

Suggested change
; scopes flow into the value and then directly out of the case
// scopes flow into the value and then directly out of the case

Copilot uses AI. Check for mistakes.

@CleanCut
Copy link
Contributor

CleanCut commented Sep 9, 2025

The github/stack-graphs repository is no longer being maintained. As per #502, I'm closing all issues and pull requests before archiving the repository.

@CleanCut CleanCut closed this Sep 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants