chore(vscode): clean up format and improve logs#4409
Merged
Conversation
582e38d to
18cf256
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR cleans up code formatting and logging in the VS Code extension while modernizing command execution by transitioning from synchronous to asynchronous patterns.
- The execAsync function is converted to an async function with consolidated logging.
- The synchronous execSync call in the format command is replaced with an asynchronous execAsync call.
- The return type of the internalFormat function is updated to reflect that no numeric result is returned.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| vscode/extension/src/utilities/exec.ts | Converted execAsync to async and centralized logging to improve clarity. |
| vscode/extension/src/commands/format.ts | Replaced execSync with execAsync and updated the return type accordingly. |
Comments suppressed due to low confidence (1)
vscode/extension/src/commands/format.ts:40
- Changing the return type from Result<number, ErrorType> to Result<undefined, ErrorType> may affect consumers expecting a numeric value on success; update documentation or ensure downstream compatibility.
const internalFormat = async (): Promise<Result<undefined, ErrorType>> => {
themisvaltinos
approved these changes
May 15, 2025
| } | ||
|
|
||
| export function execAsync( | ||
| export async function execAsync( |
Contributor
There was a problem hiding this comment.
now that this is async, does the way AbortSignal is handled in execAsyncCore with child.kill() risk leaving behind hanging processes or it is always graceful? (I'm not fully familiar with this kind of handling, just asking to understand)
Contributor
Author
There was a problem hiding this comment.
I reformated to make it slightly safer 🙏
18cf256 to
bb4e212
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.