如何向 Visual Studio Code 添加 'Remove unused imports' 快捷键
- 安装 PyLance(VSCode 扩展)
- 将以下内容添加到你的
keybindings.json(Ctrl-Shit-P -> “Preferences: Open Keyboard Shortcuts (JSON)"):
keybindings.json
,{
"key": "shift+alt+r",
"command": "editor.action.codeAction",
"args": {
"kind": "source.unusedImports",
}
}- 保存,你就可以开始使用了
Check out similar posts by category:
Visual Studio Code
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow