是否有机会将所有编译错误和警告从VSCode的Problems视图导出为某种表格格式?
如果错误的数量相当大,那么在VSCode之外的某个地方分析它们是很有用的。
发布于 2021-09-22 23:06:01
在没有扩展名的vscode中,这仍然是不可能的。所以我发表了一篇文章:
您可以复制工作区或当前文件中的所有问题。并且可以对这些进行过滤以包括/排除Errors/Warnings/Informations/Hints。
示例快捷键:
{
"key": "alt+c", // whatever keybinding you want
"command": "problems-copy.copyAll",
"args": {
"errors": true, // will be included in the result
"warnings": true
// any category not in the keybinding will be excluded from the result
// "hints": true
// "informations": true
}
}输出将添加到剪贴板。示例输出:
[
{
"resource": "/c:/Users/Mark/folder-operations/extension.js",
"code": {
"value": "no-unused-vars",
"target": {
"$mid": 1,
"path": "/docs/rules/no-unused-vars",
"scheme": "https",
"authority": "eslint.org"
}
},
"severity": 1,
"message": "'args' is defined but never used.",
"source": "eslint",
"startLineNumber": 32,
"startColumn": 102,
"endLineNumber": 32,
"endColumn": 106
}
]我计划生成更简单的输出,包括csv版本。您希望在csv或简单输出中包含哪些字段?
发布于 2021-11-01 10:50:59
虽然不像导出那么容易,但VSCode 1.62 (2021年10月)确实宣布:
现在,您可以在problems视图中选择并复制多个问题。
通过选择您需要的所有问题,您现在可以在一次操作中复制它们,而不必安装任何插件。
https://stackoverflow.com/questions/51743343
复制相似问题