可以修改变量名称的 Visual Studio 扩展

发布于 2025-01-11 02:17:40 字数 333 浏览 3 评论 0原文

我正在尝试构建一个 Visual Studio(不是 VSCode)扩展,它可以从工具菜单启动,并且可以在代码中重写变量名称。然而,在扩展编辑器文档(分类器、装饰等)时,我没有找到我要找的东西。

我所知道的:

  1. 我知道如何将命令添加到工具菜单
  2. 我可以打印出状态消息来调试我正在做的任何

事情 我不知道:

  1. 访问当前正在 Visual Studio 中编辑的文件
  2. 获取访问 ?
  3. 如果有方法可以区分局部变量名称、方法名称等...

我将如何解决这个问题

I'm trying to build a Visual Studio(not VSCode) extension that can be started from the tools menu and can write over variable names in code. However, while looking around extending the editor documentation(classifier, adornments etc.), I didn't find what I'm looking for.

What I do know:

  1. I figured out how to add command to the tools menu
  2. I can print out a status message for debugging whatever I'm doing

What I don't know:

  1. Getting access to the file currently being edited in Visual Studio
  2. Getting access to the code inside of it
  3. If there are methods available to differentiate local variable names, method names, etc...

How would I go about this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文