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

Commit b616a7d

Browse files
committed
Send stacktrace message from adapter
1 parent 10f483a commit b616a7d

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

src/view/App.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
import * as React from "react";
55
import "./App.css";
6-
import { DEVICE_LIST_KEY, VSCODE_MESSAGES_TO_WEBVIEW } from "./constants";
6+
import {
7+
DEVICE_LIST_KEY,
8+
VSCODE_MESSAGES_TO_WEBVIEW,
9+
DEBUG_COMMANDS,
10+
} from "./constants";
711
import { Device } from "./container/device/Device";
812

913
interface IState {
@@ -48,11 +52,15 @@ class App extends React.Component<{}, IState> {
4852
handleMessage = (event: any): void => {
4953
const message = event.data;
5054
console.log(JSON.stringify(message));
51-
if (
52-
message.command === VSCODE_MESSAGES_TO_WEBVIEW.SET_DEVICE &&
53-
message.active_device !== this.state.currentDevice
54-
) {
55-
this.setState({ currentDevice: message.active_device });
55+
switch (message.command) {
56+
case VSCODE_MESSAGES_TO_WEBVIEW.SET_DEVICE:
57+
if (message.active_device !== this.state.currentDevice) {
58+
this.setState({ currentDevice: message.active_device });
59+
}
60+
break;
61+
case DEBUG_COMMANDS.CONTINUE:
62+
case DEBUG_COMMANDS.STACK_TRACE:
63+
break;
5664
}
5765
};
5866
}

src/view/constants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,9 @@ export enum WEBVIEW_MESSAGES {
6767
export enum VSCODE_MESSAGES_TO_WEBVIEW {
6868
SET_DEVICE = "set-device",
6969
}
70+
export enum DEBUG_COMMANDS {
71+
STACK_TRACE = "stackTrace",
72+
CONTINUE = "continue",
73+
}
7074

7175
export default CONSTANTS;

0 commit comments

Comments
 (0)