Skip to content

Conversation

iisaduan
Copy link
Member

@iisaduan iisaduan commented Sep 2, 2025

Fixes redundant/incorrect break statements and broken fallthroughs (and some other statickcheck warnings)

@Copilot Copilot AI review requested due to automatic review settings September 2, 2025 20:52
Copy link
Contributor

@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 cleans up and fixes issues with switch statements throughout the codebase by removing redundant break statements, fixing broken fallthrough logic, and addressing other static analysis warnings.

  • Removes unnecessary break statements from switch cases where they provide no value
  • Converts if-else chains to more readable switch statements
  • Fixes incorrect logic flow in switch statements and conditional expressions

Reviewed Changes

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

Show a summary per file
File Description
internal/ls/utilities.go Removed redundant break statements and fixed fallthrough logic in switch cases, converted if-else chains to switch statements
internal/ls/findallreferences.go Converted if-else chain to switch statement and removed unnecessary break
internal/ls/completions.go Converted if-else chain to switch statement
internal/checker/nodebuilderimpl.go Removed redundant double negation and simplified conditional check
internal/checker/jsx.go Removed redundant conditional wrapper around code block
internal/checker/emitresolver.go Removed redundant double negation from boolean expression
internal/checker/checker.go Fixed variable declaration scope and removed redundant conditional check
internal/ast/utilities.go Fixed loop condition and control flow in GetSuperContainer function

@iisaduan iisaduan added this pull request to the merge queue Sep 3, 2025
Merged via the queue into microsoft:main with commit 4a5c3e2 Sep 3, 2025
22 checks passed
@iisaduan iisaduan deleted the switchStatementCleanUp branch September 3, 2025 20:47
Harsh1925 pushed a commit to Harsh1925/typescript-go that referenced this pull request Sep 9, 2025
zshannon pushed a commit to zshannon/typescript-go that referenced this pull request Oct 6, 2025
zshannon pushed a commit to zshannon/typescript-go that referenced this pull request Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants