Google 样式格式

问题描述

我已将这两行添加到我的 .vscode/setting.json 文件中以启用格式化功能

"java.format.settings.url": "https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml","java.format.settings.profile": "GoogleStyle"

我使用 Eclipse 键绑定作为记录。因此,当我执行 Command + Shift + O 时,我的 Java 文件中出现一个小气泡:Organize imports。但是,当我点击它时,我收到此错误消息:Running the contributed command: '_vscode_delegate_cmd_km72g93j' Failed.

知道如何解决这个问题吗?

解决方法

我使用的是 Windows,因此组织导入的键盘快捷键是 Shift+Alt+O。当我按下按键时,会立即组织导入语句。再次按 Shift+Alt+O 以显示黄色灯泡并选择 Organize Imports,出现同样的错误。

如果你翻到Log(Extension Host),你会发现导致这个错误的原因是actual command NOT FOUND _vscode_delegate_cmd_kmel0ckhenter image description here

你不需要再次点击黄色灯泡并选择组织导入,但这可能是一个问题,我已经把它放在了github:Organize imports throw the error