我正在编写一个VSCode扩展,它可以进行一些代码操作,最终我想在"Show Fixes"(灯泡(中运行"Add all missing imports"命令来解决该特定问题。
知道我该如何调用这个命令吗?
我已尝试调用:vscode.commands.executeCommand('problems.action.showQuickFixes');
但我得到了TypeError: Cannot read property 'getFocusElement' of null
即使在关注代码时,我也在努力修复
通过使用参数调用以下命令_typescript.applyFixAllCodeAction
来解决此问题:[document.fileName,{fixId:'fixMissingImport'}]