Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

225
Visualizações
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 Respostas
Responde à pergunta

0

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

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda