diff --git a/package.json b/package.json index 8e9a72e..3b12ac9 100644 --- a/package.json +++ b/package.json @@ -365,6 +365,11 @@ "category": "Ruff", "command": "ruff.executeOrganizeImports" }, + { + "title": "Print debug information (native server only)", + "category": "Ruff", + "command": "ruff.debugInformation" + }, { "title": "Restart Server", "category": "Ruff", diff --git a/src/extension.ts b/src/extension.ts index 598a7e6..e8bcdc2 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -191,6 +191,8 @@ export async function activate(context: vscode.ExtensionContext): Promise }); }), registerCommand(`${serverId}.executeFormat`, async () => { + // let configuration = getConfiguration(serverId) as ISettings; + if (!lsClient) { return; } @@ -240,6 +242,20 @@ export async function activate(context: vscode.ExtensionContext): Promise ); }); }), + registerCommand(`${serverId}.debugInformation`, async () => { + let configuration = getConfiguration(serverId) as unknown as ISettings; + if (!lsClient || !configuration.nativeServer) { + return; + } + + const params = { + command: `${serverId}.printDebugInformation`, + }; + + await lsClient.sendRequest(ExecuteCommandRequest.type, params).then(undefined, async () => { + await vscode.window.showErrorMessage("Failed to print debug information."); + }); + }), registerLanguageStatusItem(serverId, serverName, `${serverId}.showLogs`), );