chore(vscode): removing legacy format methods#5125
Conversation
There was a problem hiding this comment.
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
sqlmeshExecfunction 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', | ||
| }) |
There was a problem hiding this comment.
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.
| return err({ | ||
| type: 'generic', | ||
| message: 'LSP is not available', | ||
| }) |
There was a problem hiding this comment.
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({...}) }
f18796b to
fddd6a1
Compare
No description provided.