添加自定义输出解析器
自定义输出解析器会扫描命令行输出,查找您指定的错误和警告模式,并在问题中为找到的模式创建条目。
要添加或更改自定义输出解析器,请选择首选项>Build & Run >Custom Output Parsers 。
要编辑自定义输出分析程序的设置,请在列表中选择该程序,然后选择Edit 。
要在所有构建或运行配置中默认使用自定义输出分析程序,请选择Build default 或Run default 。
要移除选定的解析器,请选择Remove 。
设置自定义解析器首选项
您可以根据在Error 和Warning 选项卡中指定的设置,分别捕获错误和警告。
要创建自定义输出分析程序,请
- 选择首选项>Build & Run >Custom Output Parsers >Add 。
- 在Error message capture pattern 字段中,指定一个正则表达式来定义什么是错误。自定义解析器会根据正则表达式逐行匹配编译输出,并在Issues 中显示错误。创建包含文件名、行号和错误信息的正则表达式组。
- 在Capture Positions 字段中,将正则表达式组映射到File name 、Line number 和Message 。
- 在Capture Output Channels 字段中,指定应捕获来自标准输出、标准错误还是两个通道的信息。
- 在Test 组中,可以测试在Error message 字段中输入的消息在使用当前设置时是如何匹配的。
- 选择OK ,将分析程序添加到分析程序列表中,然后返回Custom Output Parsers 选项卡。
- 双击分析程序名称,将其更改为比默认值更具描述性的名称。
另请参阅 激活自定义输出解析器、配置用于构建的项目和配置用于运行的项目。
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.