Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
Send stacktrace message from adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
xnkevinnguyen committed Feb 21, 2020
1 parent 10f483a commit b616a7d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/view/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

import * as React from "react";
import "./App.css";
import { DEVICE_LIST_KEY, VSCODE_MESSAGES_TO_WEBVIEW } from "./constants";
import {
DEVICE_LIST_KEY,
VSCODE_MESSAGES_TO_WEBVIEW,
DEBUG_COMMANDS,
} from "./constants";
import { Device } from "./container/device/Device";

interface IState {
Expand Down Expand Up @@ -48,11 +52,15 @@ class App extends React.Component<{}, IState> {
handleMessage = (event: any): void => {
const message = event.data;
console.log(JSON.stringify(message));
if (
message.command === VSCODE_MESSAGES_TO_WEBVIEW.SET_DEVICE &&
message.active_device !== this.state.currentDevice
) {
this.setState({ currentDevice: message.active_device });
switch (message.command) {
case VSCODE_MESSAGES_TO_WEBVIEW.SET_DEVICE:
if (message.active_device !== this.state.currentDevice) {
this.setState({ currentDevice: message.active_device });
}
break;
case DEBUG_COMMANDS.CONTINUE:
case DEBUG_COMMANDS.STACK_TRACE:
break;
}
};
}
Expand Down
4 changes: 4 additions & 0 deletions src/view/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,9 @@ export enum WEBVIEW_MESSAGES {
export enum VSCODE_MESSAGES_TO_WEBVIEW {
SET_DEVICE = "set-device",
}
export enum DEBUG_COMMANDS {
STACK_TRACE = "stackTrace",
CONTINUE = "continue",
}

export default CONSTANTS;

0 comments on commit b616a7d

Please sign in to comment.