Skip to content

Commit

Permalink
fix: return one single file when prompting for AsyncAPI files #146 (#150
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ivangsa committed Dec 19, 2022
1 parent d8a93e7 commit 6feb87f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PreviewWebPanel.ts
Expand Up @@ -62,7 +62,7 @@ async function promptForAsyncapiFile() {
if (isAsyncAPIFile(vscode.window.activeTextEditor?.document)) {
return vscode.window.activeTextEditor?.document.uri;
}
return await vscode.window.showOpenDialog({
const uris = await vscode.window.showOpenDialog({
canSelectFiles: true,
canSelectFolders: false,
canSelectMany: false,
Expand All @@ -71,6 +71,7 @@ async function promptForAsyncapiFile() {
AsyncAPI: ['yml', 'yaml', 'json'],
},
});
return uris?.[0];
}

function getWebviewContent(context: vscode.ExtensionContext, webview: vscode.Webview, asyncapiFile: vscode.Uri) {
Expand Down
3 changes: 3 additions & 0 deletions src/extension.ts
Expand Up @@ -28,6 +28,9 @@ export function activate(context: vscode.ExtensionContext) {
console.log('Reloading asyncapi file', document.uri.fsPath);
openAsyncAPI(context, document.uri);
}
if (vscode.window.activeTextEditor?.document) {
setAsyncAPIPreviewContext(vscode.window.activeTextEditor.document);
}
});


Expand Down

0 comments on commit 6feb87f

Please sign in to comment.