摘要:
为解决代码注释中添加修改日期时间的需求,发现Visual Commander插件可为VS2026扩展功能。通过编写简单C#代码实现自动插入当前时间功能,关键是将Selection转换为TextSelection类型。该插件官网提供51个示例(部分VB代码),可借助AI转换为C#代码满足多种开发需求。
在编写代码的时候,希望在方法的注释中添加一个修改日期和时间。
使用Code Snippet 发现不行。
找插件,也没找到。
不过找到了这个插件,Visual Commander可以为VS2026简单地扩展一下功能。
官网:https://vlasovstudio.com/visual-commander/commands.html
一段简单的代码就可以完成需要的功能
usingSystem;usingEnvDTE;usingEnvDTE80;usingMicrosoft