在 VSCode 扩展中使用"添加所有缺少的导入"调用 execute命令



我正在编写一个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'}]

最新更新