Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gillianplatform/sedap",
"version": "0.0.3",
"version": "0.0.4",
"description": "Monorepo for JavaScript libraries for SEDAP",
"repository":"https://github.com/gillianplatform/sedap-js",
"workspaces": [
Expand Down
4 changes: 2 additions & 2 deletions react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gillianplatform/sedap-react",
"version": "0.0.3",
"version": "0.0.4",
"description": "React components for SEDAP",
"repository":"https://github.com/gillianplatform/sedap-js",
"type": "module",
Expand All @@ -27,7 +27,7 @@
"@eslint/compat": "^1.2.4",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.17.0",
"@gillianplatform/sedap-types": "0.0.3",
"@gillianplatform/sedap-types": "0.0.4",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-interactions": "^8.4.7",
"@storybook/addon-onboarding": "^8.4.7",
Expand Down
2 changes: 1 addition & 1 deletion types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gillianplatform/sedap-types",
"version": "0.0.3",
"version": "0.0.4",
"description": "SEDAP types for TypeScript",
"repository":"https://github.com/gillianplatform/sedap-js",
"types": "./src/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions vscode/ext/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gillianplatform/sedap-vscode-ext",
"version": "0.0.3",
"version": "0.0.4",
"description": "SEDAP-related utilities for VSCode extensions",
"repository":"https://github.com/gillianplatform/sedap-js",
"type": "commonjs",
Expand All @@ -27,8 +27,8 @@
"@eslint/compat": "^1.2.4",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.17.0",
"@gillianplatform/sedap-types": "0.0.3",
"@gillianplatform/sedap-vscode-types": "0.0.3",
"@gillianplatform/sedap-types": "0.0.4",
"@gillianplatform/sedap-vscode-types": "0.0.4",
"@types/vscode": "^1.96.0",
"@typescript-eslint/eslint-plugin": "^8.18.2",
"@typescript-eslint/parser": "^8.18.2",
Expand Down
32 changes: 27 additions & 5 deletions vscode/ext/src/SEDAPSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type SEDAPSessionPartialProps = {
webviewOptions?: WebviewPanelOptions & WebviewOptions;
webviewShowOptions?: ViewColumn | { viewColumn: ViewColumn; preserveFocus?: boolean };
showPanel?: boolean;
log?: boolean;
};

export type SEDAPSessionProps = SEDAPSessionPartialProps & {
Expand All @@ -45,8 +46,15 @@ export default class SEDAPSession implements Disposable {
private disposables: Disposable[] = [];
private disposed = false;
private disposeListeners: ((session: SEDAPSession) => void)[] = [];
private log_ = false;
// #endregion

private log(...data: unknown[]) {
if (this.log_) {
console.log("SEDAP:", ...data);
}
}

private async cusomDebuggerCommand<T extends SEDAPCommandType>(
command: T,
args: SEDAPCommandArgs<T>,
Expand Down Expand Up @@ -126,9 +134,11 @@ export default class SEDAPSession implements Disposable {
return;
}
if (this.panel) {
this.log("SEDAP: Revealing existing panel", { this: this });
this.panel.reveal();
} else {
this.createWebview();
this.log("SEDAP: Created webview", { this: this });
}
}

Expand All @@ -149,10 +159,13 @@ export default class SEDAPSession implements Disposable {

public dispose() {
if (!this.disposed) {
this.log("SEDAP: Disposing...", { this: this });
this.disposables.forEach((x) => x.dispose());
this.panel?.dispose();
this.disposeListeners.forEach((f) => f(this));
this.disposed = true;
} else {
this.log("SEDAP: Already disposed!", { this: this });
}
}

Expand All @@ -164,6 +177,7 @@ export default class SEDAPSession implements Disposable {
webviewOptions = {},
webviewShowOptions = ViewColumn.Two,
showPanel = false,
log = false,
}: SEDAPSessionProps) {
this.panelName = panelName || session.name;
this.panelIcon = panelIcon;
Expand All @@ -172,6 +186,9 @@ export default class SEDAPSession implements Disposable {
this.webviewOptions = { ...defaultWebviewOptions, ...webviewOptions };
this.webviewShowOptions = webviewShowOptions;
this.getWebviewHtml = getWebviewHtml;
this.log_ = log;

this.log("SEDAP: Session started", { this: this });

vscode.debug.onDidReceiveDebugSessionCustomEvent(
({ session, event, body }) => {
Expand All @@ -183,11 +200,16 @@ export default class SEDAPSession implements Disposable {
this.disposables,
);

vscode.debug.onDidTerminateDebugSession((session) => {
if (session.id === this.session.id) {
this.dispose();
}
});
vscode.debug.onDidTerminateDebugSession(
(session) => {
this.log("SEDAP: Session terminated", { this: this, other: session });
if (session.id === this.session.id) {
this.dispose();
}
},
this,
this.disposables,
);

if (showPanel) {
this.showWebviewPanel();
Expand Down
4 changes: 2 additions & 2 deletions vscode/types/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@gillianplatform/sedap-vscode-types",
"version": "0.0.3",
"version": "0.0.4",
"description": "Types for SEDAP VSCode helper libraries",
"repository":"https://github.com/gillianplatform/sedap-js",
"types": "./src/index.d.ts",
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@gillianplatform/sedap-types": "0.0.3",
"@gillianplatform/sedap-types": "0.0.4",
"typescript": "^5.7.2"
}
}
8 changes: 4 additions & 4 deletions vscode/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gillianplatform/sedap-vscode-ui",
"version": "0.0.3",
"version": "0.0.4",
"description": "SEDAP-related utilities for webviews inside VSCode extensions",
"repository":"https://github.com/gillianplatform/sedap-js",
"type": "module",
Expand All @@ -25,8 +25,8 @@
"@eslint/compat": "^1.2.4",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.17.0",
"@gillianplatform/sedap-types": "0.0.3",
"@gillianplatform/sedap-vscode-types": "0.0.3",
"@gillianplatform/sedap-types": "0.0.4",
"@gillianplatform/sedap-vscode-types": "0.0.4",
"@types/react": "^19.0.2",
"@types/vscode-webview": "^1.57.5",
"@typescript-eslint/eslint-plugin": "^8.18.2",
Expand All @@ -46,7 +46,7 @@
"vite-plugin-dts": "^4.4.0"
},
"peerDependencies": {
"@gillianplatform/sedap-react": "0.0.3",
"@gillianplatform/sedap-react": "0.0.4",
"react": "^19.0.0",
"react-icons": "^5.4.0"
},
Expand Down