visual studio“find”相当于grep -C10

时间:2017-10-23 22:39:44

标签: c# visual-studio visual-studio-2015

我习惯在unix环境中执行此操作,以查看上下文中的源代码:

$ find . | xargs grep -i -n -C10 "some function or term"

这有助于我查看我正在搜索的字符串的上下文

在Visual Studio中,我可以在源代码中查找和搜索术语,但不能使用任何上下文...这可能吗?

因此,虽然典型的查找结果如下所示:

D:\Path\To\File\SomeFile.cs(215): someFunctionIWannaSee(@Model.Foo.Bar());

我希望看到更像这样的东西:

                                  {some code above what I want to find}
                                  {some code above what I want to find}
                                  {some code above what I want to find}
                                  {some code above what I want to find}
D:\Path\To\File\SomeFile.cs(215): someFunctionIWannaSee(@Model.Foo.Bar());
                                  {some code below what I want to find}
                                  {some code below what I want to find}
                                  {some code below what I want to find}
                                  {some code below what I want to find}

0 个答案:

没有答案