Skip to content

chore(vscode): removing legacy format methods#5125

Merged
benfdking merged 1 commit intomainfrom
removing_legacy_setup
Aug 11, 2025
Merged

chore(vscode): removing legacy format methods#5125
benfdking merged 1 commit intomainfrom
removing_legacy_setup

Conversation

@benfdking
Copy link
Contributor

No description provided.

@benfdking benfdking requested review from Copilot and themisvaltinos and removed request for themisvaltinos August 11, 2025 14:37
Copy link
Contributor

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 removes legacy format methods from the VS Code extension by eliminating CLI-based formatting fallbacks in favor of LSP-only approach. The change modernizes the codebase by removing deprecated code paths and simplifying the format command implementation.

  • Removes the deprecated sqlmeshExec function from the sqlmesh utilities
  • Eliminates CLI fallback logic in the format command, keeping only LSP-based formatting
  • Simplifies error handling by removing try-catch blocks and legacy error paths

Reviewed Changes

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

File Description
vscode/extension/src/utilities/sqlmesh/sqlmesh.ts Removes the deprecated sqlmeshExec function (109 lines)
vscode/extension/src/commands/format.ts Simplifies format command to use only LSP, removes CLI fallback and unused imports

return err({
type: 'generic',
message: 'LSP is not available',
})
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

The conditional check for lsp is now redundant since the function immediately returns an error if LSP is not available. Consider removing this conditional and the corresponding closing brace, or add an early return pattern to make the logic clearer.

Copilot uses AI. Check for mistakes.
return err({
type: 'generic',
message: 'LSP is not available',
})
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

The error handling logic is inconsistent. If lsp is falsy, the function should return an error immediately rather than after the conditional block. Consider restructuring with an early return pattern: if (!lsp) { return err({...}) }

Copilot uses AI. Check for mistakes.
@benfdking benfdking force-pushed the removing_legacy_setup branch from f18796b to fddd6a1 Compare August 11, 2025 14:48
@benfdking benfdking merged commit aeee1b8 into main Aug 11, 2025
27 of 28 checks passed
@benfdking benfdking deleted the removing_legacy_setup branch August 11, 2025 15:02
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