Skip to content

Commit eb78f3b

Browse files
✅ Merge pull request #1 from soumyaprasadrana/dev
✅ Copyrights updated
2 parents 721c323 + 85d908e commit eb78f3b

17 files changed

Lines changed: 220 additions & 152 deletions

.github/workflows/publish.yaml

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,22 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
# Step 1: Check out the repository
1312
- name: Checkout repository
1413
uses: actions/checkout@v3
15-
16-
# Step 2: Set up Node.js (required for vsce)
1714
- name: Set up Node.js
1815
uses: actions/setup-node@v3
1916
with:
20-
node-version: '18' # specify the Node.js version compatible with your project
21-
22-
# Step 3: Install dependencies
17+
node-version: '20'
2318
- name: Install dependencies
2419
run: npm install
25-
26-
# Step 4: Package and publish the extension using vsce
27-
- name: Publish Extension
28-
env:
29-
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
30-
run: |
31-
npm install -g @vscode/vsce
32-
vsce package
33-
vsce publish || exit 1 # Fail the workflow if publish fails
34-
35-
# Step 5: Update Release Notes (optional)
36-
- name: Update release to published
37-
if: success()
38-
uses: actions/github-script@v6
20+
- name: Publish to Open VSX Registry
21+
uses: HaaLeo/publish-vscode-extension@v1
22+
id: publishToOpenVSX
23+
with:
24+
pat: ${{ secrets.OPEN_VSX_TOKEN }}
25+
- name: Publish to Visual Studio Marketplace
26+
uses: HaaLeo/publish-vscode-extension@v1
3927
with:
40-
script: |
41-
const { context, github } = require('@actions/github');
42-
await github.rest.repos.updateRelease({
43-
owner: context.repo.owner,
44-
repo: context.repo.repo,
45-
release_id: context.payload.release.id,
46-
draft: false, # Make it a published release only if the workflow succeeds
47-
prerelease: false
48-
});
28+
pat: ${{ secrets.VSCE_TOKEN }}
29+
registryUrl: https://marketplace.visualstudio.com
30+
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ To install the **Java DebugX** extension in Visual Studio Code:
4848
3. Search for **Java DebugX**.
4949
4. Click **Install**.
5050

51-
Alternatively, you can install it directly from the [Marketplace](https://marketplace.visualstudio.com/items?itemName=soumyaprasadrana.vscode-java-debugx).
51+
Here's the updated section with the Open VSX URL included:
52+
53+
> Alternatively, you can install it directly from the [Marketplace](https://marketplace.visualstudio.com/items?itemName=soumyaprasadrana.vscode-java-debugx) or from [Open VSX](https://open-vsx.org/extension/soumyaprasadrana/vscode-java-debugx).
5254
5355
## Getting Started
5456

@@ -58,14 +60,15 @@ Once installed, the extension is activated when a Java project is opened. You ca
5860

5961
- **Start Macro Recording**: Begin recording your debugging session. This will capture step-ins, step-outs, and breakpoints.
6062
- **Stop Macro Recording**: Stop recording and save the session data.
63+
![MacroRecActions](/media/vscode-java-debugx-macro-start-stop.gif)
6164
- **Play Macro Recording**: Re-execute the recorded session.
6265
- **Pause/Resume/Stop Macro Playback**: Pause,resume or stop the playback of your recorded debugging session.
66+
![MacroRecPlayActions](/media/vscode-java-debugx-play-macro-action-buttons.gif)
6367
- **Generate Sample Bridge Config**: Generate a sample configuration file to set up your custom bridge and define commands.
6468
- **Debug Insights**: View detailed insights from bridge configuration into your debugging session through a dedicated panel.
6569

6670
You can access these commands via the **Command Palette** (`Ctrl+Shift+P`), or find them in the **JavaDebugX** menu.
6771

68-
*You can add screenshots or GIFs of key actions here to guide users through the workflow.*
6972

7073
## Configuration
7174

@@ -85,8 +88,6 @@ You can access and modify these settings in the **Settings** tab or directly in
8588

8689
- **Debug Toolbar**: Commands for controlling the macro recording and playback are available in the debug toolbar.
8790

88-
*You can add a screenshot or GIF of the Insights view here.*
89-
9091
## Example Usage
9192

9293
### Generating a Sample Bridge Config

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"name": "vscode-java-debugx",
33
"displayName": "Java DebugX",
4-
"description": "An enhanced Java debugging experience for Visual Studio Code with advanced macro recording and playback capabilities. Supports step-in, step-out, breakpoints, and customizable debugging sessions in JSON format.",
4+
"description": "Java DebugX enhances Java debugging in Visual Studio Code by providing advanced features such as macro recording, runtime insights, and dynamic method invocation.",
55
"author": {
66
"name": "Soumya Prasad Rana",
77
"email": "soumyaprasad.rana@gmail.com"
88
},
9-
"version": "1.0.0",
9+
"version": "1.0.2",
1010
"publisher": "soumyaprasadrana",
1111
"icon": "vscode-java-debugx.png",
1212
"engines": {
1313
"vscode": "^1.60.0"
1414
},
15-
"license": "SEE LICENSE IN LICENSE",
15+
"license": "MIT",
1616
"repository": {
1717
"type": "git",
1818
"url": "https://github.com/soumyaprasadrana/vscode-java-debugx.git"

src/bridgeConfig.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
// bridgeConfig.ts
1+
// Copyright (c) 2024 Soumya Prasad Rana
2+
//
3+
// Licensed under the MIT License. See the LICENSE file in the project root for license information.
4+
//
5+
// Author: Soumya Prasad Rana
6+
// Email: soumyaprasad.rana@gmail.com
7+
28
import * as fs from 'fs';
39
import * as vscode from 'vscode';
410
import { Logger } from './logger';
@@ -7,10 +13,10 @@ export interface CommandConfig {
713
title: string;
814
command: string;
915
responseid: string;
10-
reponsetype?:string;
16+
reponsetype?: string;
1117
args?: string[];
1218
autotrigger?: boolean;
13-
hideonerror?:boolean;
19+
hideonerror?: boolean;
1420
presentation?: { //not yet implemented
1521
[key: string]: {
1622
type: "list" | "tree" | "plain";
@@ -19,8 +25,8 @@ export interface CommandConfig {
1925
};
2026
events: Events; // Configuration for events
2127
persistOnStackChange?: boolean; // Indicates whether to persist data on stack changes, default: true
22-
destructure?:boolean, //whether to de structure the data
23-
destructurepath?:string
28+
destructure?: boolean, //whether to de structure the data
29+
destructurepath?: string
2430
}
2531

2632
interface Events {
@@ -69,8 +75,8 @@ export class BridgeConfigManager {
6975
return;
7076
for (const command of this.config.commands) {
7177
if (command.autotrigger) {
72-
if(!this.config.autoTriggers)
73-
this.config.autoTriggers=[]
78+
if (!this.config.autoTriggers)
79+
this.config.autoTriggers = []
7480
this.config.autoTriggers.push(command);
7581
}
7682
}

src/bridgeResponseProvider.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
import * as vscode from 'vscode';
2+
// Copyright (c) 2024 Soumya Prasad Rana
3+
//
4+
// Licensed under the MIT License. See the LICENSE file in the project root for license information.
5+
//
6+
// Author: Soumya Prasad Rana
7+
// Email: soumyaprasad.rana@gmail.com
28

39
// Represents a single response entry in the tree view with added styling
410
class BridgeResponseItem extends vscode.TreeItem {
@@ -8,10 +14,10 @@ class BridgeResponseItem extends vscode.TreeItem {
814
public readonly collapsibleState: vscode.TreeItemCollapsibleState
915
) {
1016
super(label, collapsibleState);
11-
17+
1218
// Set description with styled value representation
1319
this.description = this.getFormattedDescription(value);
14-
20+
1521
// Dynamically assign icon based on value type
1622
this.iconPath = this.getIcon(value);
1723
}
@@ -82,7 +88,7 @@ export class BridgeResponseProvider implements vscode.TreeDataProvider<BridgeRes
8288
this._onDidChangeTreeData.fire(undefined);
8389
}
8490

85-
public getResponsesCopy() : Map<string,any>{
91+
public getResponsesCopy(): Map<string, any> {
8692
return new Map(this.responses);
8793
}
8894

@@ -91,7 +97,7 @@ export class BridgeResponseProvider implements vscode.TreeDataProvider<BridgeRes
9197
this._onDidChangeTreeData.fire(undefined);
9298
}
9399

94-
public remove(key:string){
100+
public remove(key: string) {
95101
this.responses.delete(key);
96102
}
97103

src/bridgeconfigschemaprovider.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Copyright (c) 2024 Soumya Prasad Rana
2+
//
3+
// Licensed under the MIT License. See the LICENSE file in the project root for license information.
4+
//
5+
// Author: Soumya Prasad Rana
6+
// Email: soumyaprasad.rana@gmail.com
17
export const bridgeConfigSchema = {
28
"$schema": "http://json-schema.org/draft-07/schema#",
39
"title": "Java DebugX Bridge Config",

src/commandArgumentsParser.ts

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Copyright (c) 2024 Soumya Prasad Rana
2+
//
3+
// Licensed under the MIT License. See the LICENSE file in the project root for license information.
4+
//
5+
// Author: Soumya Prasad Rana
6+
// Email: soumyaprasad.rana@gmail.com
17
import * as vscode from 'vscode';
28
import * as fs from 'fs';
39
import * as path from 'path';
@@ -6,7 +12,7 @@ import { DebugInfoStore, debugSessionEval } from './handleGetDebugInsights';
612
export class CommandArgumentsParser {
713
private workspaceFolder: string;
814
private debugInfoStore: DebugInfoStore;
9-
private persistValues:Map<String,any> = new Map<String,any>();
15+
private persistValues: Map<String, any> = new Map<String, any>();
1016

1117
constructor(debugInfoStore: DebugInfoStore) {
1218
// Get the first workspace folder or set an empty string if no workspace is open
@@ -31,40 +37,40 @@ export class CommandArgumentsParser {
3137
? filePath
3238
: path.resolve(this.workspaceFolder, filePath);
3339

34-
return `"${ (await this.readFileContent(resolvedPath)).replace(/"/g, '\\"')}"`;
40+
return `"${(await this.readFileContent(resolvedPath)).replace(/"/g, '\\"')}"`;
3541
}
3642
if (arg.startsWith('$persist:')) {
3743
let evalCommand = arg.substring('$persist:'.length);
38-
if(this.persistValues.has(evalCommand))
44+
if (this.persistValues.has(evalCommand))
3945
return `${this.persistValues.get(evalCommand)}`
40-
else{
41-
if(this.debugInfoStore.hasActiveDebugInfo()){
46+
else {
47+
if (this.debugInfoStore.hasActiveDebugInfo()) {
4248
const stackFrame = this.debugInfoStore.getActiveDebugInfo().stackFrame;
43-
if(stackFrame == null){
49+
if (stackFrame == null) {
4450
return evalCommand; //let expression ebaluated at command execution runtime
4551
}
46-
const evalRes = await debugSessionEval(stackFrame.session,stackFrame,evalCommand);
47-
if(!evalRes){
52+
const evalRes = await debugSessionEval(stackFrame.session, stackFrame, evalCommand);
53+
if (!evalRes) {
4854
return evalCommand;
4955
}
50-
if(evalRes.startsWith("{")){
56+
if (evalRes.startsWith("{")) {
5157
const evalResObj = JSON.parse(evalRes);
52-
if(evalResObj.status && evalResObj.status=="evalerror"){
58+
if (evalResObj.status && evalResObj.status == "evalerror") {
5359
return evalCommand;
54-
}else{
55-
this.persistValues.set(evalCommand,evalRes);
60+
} else {
61+
this.persistValues.set(evalCommand, evalRes);
5662
return evalRes;
5763
}
58-
}else{
59-
this.persistValues.set(evalCommand,evalRes)
64+
} else {
65+
this.persistValues.set(evalCommand, evalRes)
6066
return evalRes;
6167
}
62-
}else{
68+
} else {
6369
return evalCommand;
6470
}
65-
71+
6672
}
67-
73+
6874
}
6975

7076
// If no function detected, return the argument as-is
@@ -75,7 +81,7 @@ export class CommandArgumentsParser {
7581
try {
7682
// Read file contents as a string
7783
return fs.promises.readFile(filePath, 'utf-8');
78-
} catch (error:any) {
84+
} catch (error: any) {
7985
vscode.window.showErrorMessage(`Error reading file at ${filePath}: ${error.message}`);
8086
return ''; // Return an empty string if file reading fails
8187
}

0 commit comments

Comments
 (0)