[vscode-shared] Add outputMarker option to runWorkspaceCommandAsync#5590
Closed
[vscode-shared] Add outputMarker option to runWorkspaceCommandAsync#5590
Conversation
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
…arch Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor string marking logic into runWorkspaceCommandAsync
[vscode-shared] Add outputMarker option to runWorkspaceCommandAsync
Feb 3, 2026
TheLarkInn
requested changes
Feb 3, 2026
vscode-extensions/vscode-shared/src/runWorkspaceCommandAsync.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
TheLarkInn
requested changes
Feb 3, 2026
vscode-extensions/playwright-local-browser-server-vscode-extension/src/extension.ts
Outdated
Show resolved
Hide resolved
TheLarkInn
approved these changes
Feb 3, 2026
dmichon-msft
requested changes
Feb 4, 2026
Comment on lines
+94
to
+95
| const startIndex: number = outputStream.indexOf(outputMarker.prefix); | ||
| const endIndex: number = outputStream.indexOf(outputMarker.suffix); |
Contributor
There was a problem hiding this comment.
Per prior conversation regarding the debug certificate manager, to deal with some shells that echo the command to be run, we should be using lastIndexOf instead of indexOf, and also should anchor one from the other.
Comment on lines
+9
to
+12
| * Options for extracting a specific value from the command output using markers. | ||
| * When provided, the function will search for the markers in the command output and | ||
| * return only the content between them. This is useful for extracting specific | ||
| * values from shell output that may contain additional noise. |
Contributor
There was a problem hiding this comment.
Need to explicitly define the behavior when the markers appear multiple times.
Member
|
After talking with Bharat we're going to just leave this refactor as is. It doesn't really help much, however we can still refactor to use lastIndexOf() in a separate PR. |
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.
outputMarkeroption torunWorkspaceCommandAsyncfunctiondebug-certificate-manager-vscode-extensionto use the new optionplaywright-local-browser-server-vscode-extensionto use the new optionnode -pextraction from function - callers provide full commandSummary
This PR refactors the duplicate string marker logic from two VS Code extensions into
runWorkspaceCommandAsync.Changes:
IOutputMarkerOptionsinterface withprefixandsuffixpropertiesoutputMarkeris provided, the function extracts only the content between the markers from the outputSecurity Summary
No security vulnerabilities detected by CodeQL.
Original prompt
runWorkspaceCommandAsync#5589💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.