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

226
Vistas
How to get selected diagnostic in my VS Code Extension?

With the help of the VS Code Extension API, I can get all current diagnostics in the open editors like this:

const allDiagnostics = vscode.languages.getDiagnostics();

I have written a command that deletes all mentions that generate these diagnostics: when you hover on the diagnostic, and click "Quick Fix...", the command appears, and after clicking it, all those mentions that produce the diagnostics are deleted from the editor:

command

However, I have not been able to find a way to get the selected diagnostic. For example, in the picture above, I would like the command to delete only Calibrate(), and not the other mentions that produce diagnostics in the editor. Something like:

const selectedDiagnostic = vscode.languages.getSelectedDiagnostic();

Is there a way to retrieve in my code only the selected diagnostic?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In the CodeActionProvider in the method provideCodeActions the diagnostic is in the context parameter

about 4 years ago · Juan Pablo Isaza Denunciar
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