How to use the vscode-debugadapter.OutputEvent function in vscode-debugadapter

To help you get started, we’ve selected a few vscode-debugadapter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebookarchive / atom-ide-ui / modules / atom-ide-debugger-python / VendorLib / vs-py-debugger / out / client / debugger / mainV2.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
        vscode_debugadapter_1.logger.init(core_utils_1.noop, path.join(__dirname, '..', '..', '..', 'experimental_debug.log'));
        const serviceContainer = serviceRegistry_1.initializeIoc();
        const protocolMessageWriter = serviceContainer.get(types_2.IProtocolMessageWriter);
        try {
            // debugger;
            const debugManager = new DebugManager(serviceContainer);
            yield debugManager.start();
        }
        catch (err) {
            const message = `Debugger Error: ${err && err.message ? err.message : err.toString()}`;
            const details = [message, err && err.name ? err.name : '', err && err.stack ? err.stack : ''].join(os_1.EOL);
            vscode_debugadapter_1.logger.error(`${message}${os_1.EOL}${details}`);
            // Notify the user.
            protocolMessageWriter.write(process.stdout, new messages_1.Event('error', message));
            protocolMessageWriter.write(process.stdout, new vscode_debugadapter_1.OutputEvent(`${message}${os_1.EOL}${details}`, 'stderr'));
        }
    });
}
github facebookarchive / atom-ide-ui / modules / nuclide-debugger-vsps / vscode-ocaml / OCamlDebugger.js View on Github external
fn().catch(error => {
      const errorMessage = error.stack || error.message || String(error);
      if (response != null) {
        response.success = false;
        // $FlowIgnore: returning an ErrorResponse.
        response.body = {
          error: {
            id: -1,
            format: errorMessage,
          },
        };
        this.sendResponse(response);
      }
      this.sendEvent(
        new OutputEvent(
          `OCaml Debugger ran into an error:\n\`${errorMessage}\``,
          'nuclide_notification',
          {type: 'error'},
        ),
      );
      this.sendEvent(new TerminatedEvent());
    });
  }
github fduman / vscode-nodemcu / client / src / debug.ts View on Github external
terminal.registerOnDataReceived((data: string) => {
			this._inputBuffer += data;
			
			if (this._inputBuffer.indexOf("\n") >= 0) {
				let out = this._inputBuffer.split(/\r?\n/);

				for (let i: number = 0; i < out.length - 1; i++) {
					this.sendEvent(new OutputEvent(out[i]));
				}

				this._inputBuffer = out[out.length-1];
			}
			else if (this._inputBuffer.length > 120) {
				this.sendEvent(new OutputEvent(this._inputBuffer));
				this._inputBuffer = "";
			}
		});
github facebookarchive / atom-ide-ui / modules / atom-ide-debugger-python / VendorLib / vs-py-debugger / out / client / debugger / Main.js View on Github external
onPythonException(pyThread, ex) {
        this.lastException = ex;
        this.sendEvent(new vscode_debugadapter_1.StoppedEvent("exception", pyThread.Int32Id, `${ex.TypeName}, ${ex.Description}`));
        this.sendEvent(new vscode_debugadapter_1.OutputEvent(`${ex.TypeName}, ${ex.Description}\n`, "stderr"));
    }
    onPythonThreadExited(pyThread) {
github Dart-Code / Dart-Code / src / debug / flutter_multi_reload_debug_impl.ts View on Github external
process.stderr.on("data", (data) => {
			this.sendEvent(new OutputEvent(data.toString(), "stderr"));
		});
		process.on("error", (error) => {
github hackwaly / vscode-ocaml / src / debug / debug.ts View on Github external
let onceSocketListened = (message: string) => {
            if (once) return;
            once = true;

            if (this._remoteMode) {
                this.sendEvent(new OutputEvent(message));
            } else {
                launchDebuggee();
            }
        };
github otris / vscode-janus-debug / src / debugSession.ts View on Github external
private debugConsole(message: string): void {
        this.sendEvent(new OutputEvent(message + '\n', 'console'));
    }
github microsoft / vscode-chrome-debug-core / src / chrome / client / eventsToClientReporter.ts View on Github external
public sendOutput(params: IOutputParameters): void {
        const event = new OutputEvent(params.output, params.category) as DebugProtocol.OutputEvent;

        if (params.variablesReference) {
            event.body.variablesReference = params.variablesReference;
        }

        if (params.location) {
            this._locationInSourceToClientConverter.toLocationInSource(params.location, event.body);
        }

        this._session.sendEvent(event);
    }
github facebookarchive / atom-ide-ui / modules / atom-ide-debugger-node / VendorLib / vscode-node-debug2 / out / src / nodeDebugAdapter.js View on Github external
nodeProcess.stdout.on('data', (data) => {
                if (noDebugMode || this._captureFromStd) {
                    let msg = data.toString();
                    this._session.sendEvent(new vscode_debugadapter_1.OutputEvent(msg, 'stdout'));
                }
            });
            resolve();
github facebook / prepack / src / debugger / adapter / DebugAdapter.js View on Github external
outputCallback: (data: Buffer) => {
        let outputEvent = new OutputEvent(data.toString(), "stdout");
        this.sendEvent(outputEvent);
      },
      exitCallback: () => {