Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

102
Vistas
Unresolved await in extension command and running same command multiple times

I am trying to make use of vscode's window.showInformationMessage method during a command that takes a screenshot of the current screen. After the screenshot has been taken, I use

await window.showInformationMessage(`File saved to ${path}`,"Open", "Copy Path");

Which gives the user the option to either open their saved image in a file explorer or copy the path to the clipboard. However, if the user does not do anything when the Information Message dialog pops up, then this call never resolves. On top of that, the user can run the screenshot command as many times as they would like, and each time the code execution would halt, waiting for the promise to resolve.

I have used two different methods to solve this:

  1. Use a Promise.race with one parameter being a setTimeout promise
  2. Use a .then at the end of the call to showInformationMessage, and remove the async.

QUESTION 1: what is happening under the hood here? How can I run this command many times if node runs on a single thread? Is another thread being created for each command call or is there a new instance of the extension being created each time I call this command?

QUESTION 2: What is a good way to see all of this? I have used the debugger but it hasn't helped much.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda