Loading
feat: Interrupt running command when LS notifies to do so
Description
Companion MR to gitlab-org/editor-extensions/gitlab-lsp!3123 (merged). This implements the IDE extension side of command cancellation for Duo Workflow commands running in the integrated terminal.
Problem
When a user interrupts a running Duo Workflow command, the LSP sends a $/gitlab/cancelRunningCommand notification, but the IDE extension wasn't handling it. The command continued running in the terminal with no way to stop it or retrieve partial output.
Solution
- Added handler for
$/gitlab/cancelRunningCommandnotification inTerminalManager - When cancellation is requested:
- Sends
Ctrl+C(\x03) to the terminal to interrupt the running process - Immediately resolves the pending
$/gitlab/runCommandrequest with partial output collected so far
- Sends
Related Issues
References gitlab-org/editor-extensions/gitlab-lsp#2022 (closed)
How has this been tested?
- Link this MR and gitlab-org/editor-extensions/gitlab-lsp!3123 (merged)
- Ask chat to run a long-running command, e.g. "Run npm run test:unit"
- Approve the command, then click the stop button
- The terminal process is interrupted with Ctrl+C and partial output is returned to the LSP
- If
src/browserorsrc/commonhas been modified, please consider interoperability with the Web IDE. See Running the Extension in WebIDE.
What CHANGELOG entry will this MR create?
-
feature:New feature - a user-facing change which adds functionality - included in changelog -
fix:Bug fix fixes - a user-facing issue in production - included in changelog -
BREAKING CHANGE:(fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog - None - other non-user-facing changes
Edited by Olena Horal-Koretska