AI 代码 review 相关内容如下:
AI Review is a feature that allows you to review your recent changes in your codebase to catch any potential bugs.AI Review是一项功能,可让您查看代码库中的最近更改以捕获任何潜在的错误。You can click into individual review items to see the full context in the editor,and chat with the AI to get more information.
[title]AI Review (Beta) AI 评论(测试版)[heading1]AI Review (Beta) AI 评论(测试版)[heading2]您可以单击各个审阅项以查看编辑器中的完整上下文,并与 AI 聊天以获取详细信息。[heading3]Custom Review Instructions 自定义审核说明[content]In order for AI Review to work in your favor,you can provide custom instructions for the AI to focus on.For example,if you want the AI to focus on performance-related issues,you could put:为了让AI Review对您有利,您可以为AI提供自定义说明以专注于。例如,如果您希望AI专注于与性能相关的问题,您可以输入:This way,AI Review will focus on the performance of your code when scanning through your changes.这样,AI Review在扫描更改时将专注于代码的性能。
教AI就像哄小孩,有正确的需要及时肯定,不过似乎AI对否定非常敏感,指出错误的时候要克制,不断完善它的经验。现在尝试写一个复杂的Buff,作用于一个Worker,Buff生效后,Worker的生命值和速度将翻倍。Buff失败时,如果Worker的HP不大于50,Buff的效果会恢复,否则不恢复。这里用到了取Worker的HP的操作,所以我需要告知AI怎么取一个Unit的某个属性:if you want to get a certain attribute of a unit,such as Worker's HP,you can use"Worker.HP"to get it.Let's write a slightly more complicated Buff,which acts on a Worker,and Worker is a kind of Unit.When the Buff takes effect,the Worker's HP and Speed will be doubled.When the Buff fails,if the Worker's HP is not greater than 50,the effect of the Buff will be restored,otherwise it will not be restored.完全能用……再进一步,让它撰写能作用于多个Unit对象的Buff:Write a slightly more complicated Buff,which acts on the Unit.If the Unit is a Spearman,then his Attack will be increased by two.If the Unit is an Archer,then his Defense will be increased by two.总之,ChatGPT在应付简单的、模板化的代码时还是比较轻松的。核心的步骤是:1.给它看你的代码模板,确认其中的注释清晰。2.如果有新的API需要调用,需要及时告诉它。3.说出你的需求。