MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / done

Function done

Extension/src/SSH/sshCommandRunner.ts:290–308  ·  view source on GitHub ↗
(cancel: boolean = false, noClean: boolean = false, exitCode?: number)

Source from the content-addressed store, hash-verified

288 };
289
290 const done = (cancel: boolean = false, noClean: boolean = false, exitCode?: number) => {
291 if (!noClean) {
292 clean();
293 }
294 getSshChannel().appendLine(cancel ? localize('ssh.terminal.command.canceled', '"{0}" terminal command canceled.', nickname) : localize('ssh.terminal.command.done', '"{0}" terminal command done.', nickname));
295
296 if (cancel) {
297 if (continueWithoutExiting) {
298 const warningMessage: string = localize('ssh.continuing.command.canceled', 'Task \'{0}\' is canceled, but the underlying command may not be terminated. Please check manually.', command);
299 getSshChannel().appendLine(warningMessage);
300 void vscode.window.showWarningMessage(warningMessage);
301 }
302 return result.reject(new CanceledError());
303 }
304
305 // When using showLoginTerminal, stdout include the passphrase prompt, etc. Try to get just the command output on the last line.
306 const actualOutput: string | undefined = cancel ? '' : lastNonemptyLine(stdout);
307 result.resolve({ succeeded: !exitCode, exitCode, outputError: '', output: actualOutput || '' });
308 };
309
310 const failed = (error?: any) => {
311 clean();

Callers 4

gulpfile.jsFile · 0.85
handleTerminalOutputFunction · 0.85

Calls 7

getSshChannelFunction · 0.90
lastNonemptyLineFunction · 0.85
appendLineMethod · 0.80
showWarningMessageMethod · 0.80
cleanFunction · 0.70
rejectMethod · 0.65
resolveMethod · 0.65

Tested by

no test coverage detected