Skip to content

feat(vscode): print env into terminal#4789

Merged
benfdking merged 2 commits intomainfrom
print_env_function
Jun 23, 2025
Merged

feat(vscode): print env into terminal#4789
benfdking merged 2 commits intomainfrom
print_env_function

Conversation

@benfdking
Copy link
Copy Markdown
Contributor

No description provided.

@benfdking benfdking force-pushed the print_env_function branch from 96ee5e4 to 9bc8351 Compare June 23, 2025 15:51
@benfdking benfdking requested a review from Copilot June 23, 2025 16:00
Copy link
Copy Markdown
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 introduces functionality to print the SQLMesh environment variables into a VS Code terminal, enhancing debugging and operational transparency.

  • Introduces a new function (getSqlmeshEnvironment) that consolidates environment variable configuration.
  • Refactors several execution-related functions to use the unified environment from getSqlmeshEnvironment.
  • Registers and implements a new printEnvironment command and updates package.json accordingly.

Reviewed Changes

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

Show a summary per file
File Description
vscode/extension/src/utilities/sqlmesh/sqlmesh.ts Adds getSqlmeshEnvironment and replaces duplicated env merging logic.
vscode/extension/src/lsp/lsp.ts Removes temporary env workaround to use unified environment configuration.
vscode/extension/src/extension.ts Registers the new printEnvironment command.
vscode/extension/src/commands/printEnvironment.ts Implements a new command to create a terminal displaying environment vars.
vscode/extension/package.json Adds the command entry for printing environment variables.

Comment thread vscode/extension/src/commands/printEnvironment.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
const env = envResult.value

// Create a new terminal with the SQLMesh environment
const terminal = vscode.window.createTerminal({
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe possible future improvement instead of always creating a new terminal to see if one exists already

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My hesitation is that the whole point of this is to show what the lsp runs in. If you reuse, you don't quite get that.

@benfdking benfdking merged commit f5ebfbb into main Jun 23, 2025
25 checks passed
@benfdking benfdking deleted the print_env_function branch June 23, 2025 17: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.

3 participants