Skip to content

Commit 13e2e7d

Browse files
angelozerrdatho7561
authored andcommitted
Integrate Qute Debugger
Fixes #1096 Signed-off-by: azerr <[email protected]>
1 parent 8e0c555 commit 13e2e7d

File tree

3 files changed

+55
-2
lines changed

3 files changed

+55
-2
lines changed

package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,43 @@
185185
"category": "Qute"
186186
}
187187
],
188+
"breakpoints": [
189+
{
190+
"language": "qute-html"
191+
},
192+
{
193+
"language": "qute-json"
194+
},
195+
{
196+
"language": "qute-yaml"
197+
},
198+
{
199+
"language": "qute-txt"
200+
}
201+
],
202+
"debuggers": [
203+
{
204+
"type": "qute",
205+
"label": "Qute Debugger",
206+
"languages": [
207+
"qute-html",
208+
"qute-json",
209+
"qute-yaml",
210+
"qute-txt"
211+
],
212+
"configurationAttributes": {
213+
"attach": {
214+
"required": ["port"],
215+
"properties": {
216+
"port": {
217+
"type": "number",
218+
"description": "TCP port of the Qute DAP server"
219+
}
220+
}
221+
}
222+
}
223+
}
224+
],
188225
"configuration": {
189226
"title": "Quarkus Tools",
190227
"properties": {

src/extension.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
import { readFile } from 'fs-extra';
1717
import * as path from 'path';
18-
import { commands, Disposable, ExtensionContext, extensions, Terminal, TextDocument, window, workspace } from 'vscode';
18+
import { commands, Disposable, ExtensionContext, extensions, Terminal, TextDocument, window, workspace, debug } from 'vscode';
1919
import { LanguageClient } from 'vscode-languageclient/node';
2020
import { registerVSCodeClientCommands, registerVSCodeCommands } from './commands/registerCommands';
2121
import { QuarkusConfig, QuarkusPropertiesLanguageMismatch } from './QuarkusConfig';
@@ -30,6 +30,7 @@ import { initTelemetryService } from './utils/telemetryUtils';
3030
import { getFilePathsFromWorkspace } from './utils/workspaceUtils';
3131
import { WelcomeWebview } from './webviews/WelcomeWebview';
3232
import { createTerminateDebugListener } from './wizards/debugging/terminateProcess';
33+
import { QuteDebugAdapterFactory } from './qute/debugAdapter/quteDebugAdapterFactory';
3334

3435
// alias for vscode-java's ExtensionAPI
3536
export type JavaExtensionAPI = any;
@@ -57,6 +58,12 @@ export async function activate(context: ExtensionContext) {
5758
} else {
5859
doActivate(context);
5960
}
61+
62+
// Register the Qute Debugger
63+
const quteDebugFactory = new QuteDebugAdapterFactory();
64+
context.subscriptions.push(
65+
debug.registerDebugAdapterDescriptorFactory('qute', quteDebugFactory)
66+
);
6067
}
6168

6269
async function doActivate(context: ExtensionContext): Promise<void> {
@@ -101,7 +108,6 @@ async function doActivate(context: ExtensionContext): Promise<void> {
101108
}
102109
});
103110
}
104-
105111
}
106112

107113
export async function deactivate(): Promise<void> {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as vscode from 'vscode';
2+
3+
export class QuteDebugAdapterFactory implements vscode.DebugAdapterDescriptorFactory {
4+
createDebugAdapterDescriptor(
5+
session: vscode.DebugSession
6+
): vscode.ProviderResult<vscode.DebugAdapterDescriptor> {
7+
const port = session.configuration.port ?? 4711; // default port if not specified
8+
return new vscode.DebugAdapterServer(port, '127.0.0.1');
9+
}
10+
}

0 commit comments

Comments
 (0)