@language javascript
const vscode = g.app.vscode;
g.es("hahahaha");
// 'await' for doCommandByName required only if other code in script is 'awaited'.
await c.doCommandByName('insert-headline-time');
const userInput = await vscode.window.showInputBox({
placeHolder: 'Enter something', // Placeholder text in the input box
prompt: 'Please enter some text:', // Prompt message above the input box
});
if (userInput === undefined) {
g.es('User canceled the input.');
} else {
g.es('User input:', userInput);
}
try {
const response = await fetch(apiUrl);
g.es("about to call");
if (!response.ok) {
throw new Error('Network response was not ok');
}
const data = await response.json();
g.es("got it!!", JSON.stringify(data));
} catch (error) {
g.es("oh no!");
console.error('Fetch error:', error);
}