Visual Studio 代码转到下一个错误或警告,但不转到信息

Visual Studio Code go to next error or warning, but not to info

我正在使用 Visual Studio 代码,我知道我可以使用 F8 转到下一个错误。我还在使用拼写检查插件,它会向我显示 info 条消息。当我按 F8 时,我也会转到下一条 info 消息。

没那么奇怪,因为 F8 映射到“转到文件中的下一个问题(错误、警告、信息)。是否可以使用过滤器配置键绑定并仅转到下一个错误或警告?

参见添加跳转到next/previous问题的选项 。这似乎可以满足您的要求 - 您现在可以在 Insiders' Build 中对其进行测试。

正在添加此设置(在 v1.63 中到期):

Problems: Compare Order

选项:SeverityPosition


来自release notes: define problem order navigation

Define order problem navigation

You can now define the order in which "Go to Next Problem" (kb(editor.action.marker.next)) and "Go to Previous Problem" (kb(editor.action.marker.prev)) work. In previous versions navigation would happen by severity, first come errors, then warnings, then the rest. The new problems.sortOrder - configuration enables you to navigate problems by their position instead. So, a warning line 5 will be shown before an error on line 13 etc.

在我的测试中,当您按 F8(并且可能是新的默认设置)时,severity 导航到错误,而不是信息。 position 按行号顺序访问所有问题类型(错误、警告和信息)。