added a shortcut to open the loging app
This commit is contained in:
1 parent
5614ad049d
commit
f57e23d76a
7 files changed
+31
-5
No files matched your search
@@ -444,10 +444,12 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
editor.revealRange(new vscode.Range(pos, pos), vscode.TextEditorRevealType.InCenter);
|
||||
}),
|
||||
|
||||
vscode.commands.registerCommand('appdaemon.goToApp', async () => {
|
||||
const apps = await findAllApps();
|
||||
vscode.commands.registerCommand('appdaemon.goToApp', async (requestedName?: string) => {
|
||||
const apps = (await findAllApps()).filter(app => !requestedName || app.appName === requestedName);
|
||||
if (apps.length === 0) {
|
||||
vscode.window.showWarningMessage('AppDaemon: No app definitions found in workspace');
|
||||
vscode.window.showWarningMessage(requestedName
|
||||
? `AppDaemon: No definition found for ${requestedName}`
|
||||
: 'AppDaemon: No app definitions found in workspace');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -459,7 +461,7 @@ export async function activate(context: vscode.ExtensionContext) {
|
||||
app
|
||||
}));
|
||||
|
||||
const picked = await vscode.window.showQuickPick(items, {
|
||||
const picked = apps.length === 1 && requestedName ? items[0] : await vscode.window.showQuickPick(items, {
|
||||
placeHolder: 'Go to AppDaemon app…',
|
||||
matchOnDescription: true,
|
||||
matchOnDetail: false
|
||||
|
||||
@@ -58,6 +58,9 @@ export class LogExplorer implements vscode.Disposable {
|
||||
this.messageListener?.dispose();
|
||||
this.messageListener = webview.onDidReceiveMessage(async message => {
|
||||
if (message.type === 'ready') { this.publish(); }
|
||||
if (message.type === 'app' && typeof message.app === 'string') {
|
||||
await vscode.commands.executeCommand('appdaemon.goToApp', message.app);
|
||||
}
|
||||
if (message.type === 'open' && typeof message.id === 'string') {
|
||||
const entry = this.entries.get(message.id);
|
||||
if (!entry?.file) { return; }
|
||||
|
||||
Reference in new issue
Block a user