CodeRush 中操作提示 ActionHint 的使用

发布于 2024-11-25 08:48:06 字数 417 浏览 6 评论 0原文

我想将操作提示箭头指向当前类中名为 MyMethod 的方法调用。因此,如果有任何名为 MyMethod 的方法调用,当我单击某些按键组合时,箭头应该指向它们。

  1. 我尝试使用此处给出的 ActionHint 步骤来执行此操作。但我不知道该使用哪个事件。

  2. 然后我尝试通过 CodeProvider 调用 CodeRush.ActionHint.PointTo() 但没有成功。

可以写这样的插件吗?如果是,我应该使用哪个版本的 PointTo() 方法。

如果可能的话,示例代码会有所帮助。

提前致谢。

I wanted to point the action hint arrow to the methodcall named MyMethod in the current class. So if there are any methodcall with name MyMethod the arrows should be pointing them when I click some combination of keys.

  1. I tried to do this with ActionHint steps given here. But I have no idea which event to use.

  2. Then I tried to call CodeRush.ActionHint.PointTo() through CodeProvider but did not work.

Is it possible to write such plugin? If yes which version of PointTo() method should I use.

A sample code if possible would be helpful.

Thanks in Advance.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

掐死时间 2024-12-02 08:48:06

不出现操作提示的唯一原因是您的源代码点可能超出了可见的屏幕范围。在调用 PointTo() 之前,请确保目标点可见。您可以使用以下 PointTo 重载:

CodeRush.TextViews.Active.MakeVisible(MyMethodInstance.NameRange);
CodeRush.ActionHint.PointTo(MyMethodInstance.NameRange.Start, "MyMethod", Color.Red);

The only reason for which the action hint doesn't appear is that your source code point might be outside of the visible screen bounds. Before calling PointTo(), make sure that the target point is visible. You can use the following PointTo overload:

CodeRush.TextViews.Active.MakeVisible(MyMethodInstance.NameRange);
CodeRush.ActionHint.PointTo(MyMethodInstance.NameRange.Start, "MyMethod", Color.Red);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文