ReSharper:查找可选参数的用法 [英] ReSharper: Find Usages of an optional parameter

查看:87
本文介绍了ReSharper:查找可选参数的用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个带有可选参数的函数,是否有一种简单的方法可以找到我代码中调用该函数并将其值传递给该参数的所有位置?

If I have a function with optional parameter, is there an easy way to find all the locations in my code that call that function and pass a value to that parameter?

该函数具有许多非默认参数,因此扫描调用该函数的位置的常规查找用法"结果是有问题的,因为它会剪裁线条,而且我看不到是否使用了可选参数.

The function has many non-default parameters, so scanning the usual Find Usages results of places that call the function is problematic, as it trims the lines and I can't see if the optional parameter is used.

推荐答案

将光标放在参数上,选择ReSharper | Inspect | Value Origin,或者在键盘上使用 Ctrl + Inspect This Shift + Alt + A ,然后按Value Origin.

With your cursor on the parameter, choose ReSharper | Inspect | Value Origin, or from the keyboard, Inspect This with Ctrl+Shift+Alt+A, then Value Origin.

您将获得一个检查结果"窗口,其中包含明确为该参数分配值的所有位置.

You will get an Inspection Results window with all the places that explicitly assign that parameter a value.

这篇关于ReSharper:查找可选参数的用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆