Alternatives for "Find in Files" - visual-studio

I've fallen foul of the "find-in-files-isn't" issue as suggested here and reported on Connect, but it seems that the issue will not be fixed until "the next major release" of VS.
While I could live with the issue and work-around of "clean source tree, restart VS", I still can't trust that it is not giving me false negatives.
Some form of "Find in files" is critical to aggressive refactoring across a source tree, so I'm looking for an alternative. Ideally a pluging to VS, but I'd settle for a good external app that could support regex and file type filters
I don't trust Windows Search (for similar false negative reasons).
Any suggestions?

Tools I use and like:
I have found grepwin to be a good tool to find and also replace things in text files.
It is easy to install, easy to use, and it can replace... it can show the contents of the file, the line that it found the text, and has support to regular expressions. Lots of things to play with, in a single interface.
It covers all your requirements, but this: 'Ideally a pluging to VS'... but it can be integrated manually, like described bellow.
Supports: 'aggressive refactoring' =), 'regex' and 'file type filters'.
Home page or http://tools.tortoisesvn.net/grepWin.html
Download page
Integrating manually:Integrating grepWin into Visual Studio
I like it and used it for some time now.
Other tools:
If you don't like it take a look here:
http://www.thefreecountry.com/programming/searchandreplace.shtml
lots of external tools exists... you could eventually make a VS Macro to open the external application, and give it some parameters. But this is just an option... I would not follow this option, because it is too complex for the matter.

I use Resharper with Visual Studio 2008, and this lets me search through classes (with Ctrl + T) or find find through files (Ctrl + Shift + T)
Visual Studio 2010 has this search functionality built in if I can remember it correctly.

Related

Is it possible to take two files open in VS Code and open them in Beyond Compare?

I have recently switched from Sublime Text to VS Code (WIN10). I prefer VS Code now, as it' so much better, but I have something I can't figure out, and it seems crazy that there isn't a solution.
The VS Code Diff display is no good for actually editing, so I use Beyond Compare for all my diff-ing and merging.
I've searched high and low and can't find anything like a replacement for the ST3 plugin "FileDiffs" (https://packagecontrol.io/packages/FileDiffs).
I already have Beyond Compare set as my diff tool in .gitconfig, and I have the VS Code extensions for diff-ing with remote tools "when using Git" -- but what about when you just have two arbitrary files open in VS code, and I just want to open them in Beyond Compare?? This appears to be impossible in VS Code without using some very inefficient workaround.
(maybe I need to learn how to port a ST3 extension to VS Code...)
Check out PartialDiff: https://github.com/ryu1kn/vscode-partial-diff
Quoted from its docs,
You can compare (diff) text selections within a file, across different files, or to the clipboard.
Compare text in 2 visible editors (i.e. tabs) with one action.

Searching in Visual Studio 2013, 2015 hangs when results are in minified files (single long line)

We have a web project with Angular, jquery and Telerik Kendo.
When searching for any text Ctrl+Shift+F that is then found in any of their *.min.js or *.js.map files, the VS (both 2013 and now 2015) will become unresponsive for 30-60s. Also when later I scroll the Find Result 1 window, it will momentarily become unresponsive when long line becomes visible. Everything becomes smooth again if I clear the search results from Find Result 1.
We have the *.min.js and *.js.map files included in project itself. Is this wrong approach?
This is a well known problem, the Connect feedback article is here. These files are poison pills to an IDE, compare to this Q+A.
Little to add, beyond not adding them to your project, the proposed workaround in the article is the obvious one. And as long as you need to search through these files you surely want to work with the non-minimized versions of them.
In the Find options, expand "Result options" (Alt+S) and enable "Display file names only". The contents of the files will not be displayed in the find results and everything will be a lot faster. You can still double click a file name in the find results to go to the exact location of the match in that file.
Does this problem happen for everyone, or only on particular machines? Are there any Visual Studio extensions that may be slowing down the search? You could try and temporarily disable all extensions and see if you have the same problem.
Otherwise, I would agree that including the .min.js and .map files in the solution / project is not ideal anyway.
My recommendation is to use Bower to manage your 3rd party client-side library dependencies. They say use the right tool for the job, and in this case, it's currently Bower.
Bower support is baked in to Visual Studio 2015. Here's some Microsoft docs on using Bower in Visual Studio 2015:
http://docs.asp.net/en/latest/client-side/bower.html
Docs for installing Kendo using Bower: http://docs.telerik.com/kendo-ui/install/bower
Now, this by default will put those vendor libraries in a bower_components folder under the project root. You would then not include this folder in your project, or in source control (but bower.json and optional .bowerrc would go into source control).
This should alleviate your problem in VS2013, but in 2015, Find in Files will still search bower_components. So your best bet is to try and narrow down the source of the slow-down.
Using Bower potentially impacts your development and build process, so you might want to avoid that if that's going to force your hand to make other changes you're not positioned for yet.
One thing you can check to try and help solve this issues, is in your gruntfile's minify task, make sure the mangle property is set to false. Mangle changes the variable names to really short names, so sometimes that can mess up your other files that use variables from those minified files, and other errors can occur. I'm not sure why visual studio crashes or wouldn't be able to handle searching for a string that doesn't exist, but it's something to consider.

Spell-checking SpecFlow feature files in Visual Studio

Is there a Spell Checker (like http://etherealcode.com/respeller/ or http://visualstudiogallery.msdn.microsoft.com/7c8341f1-ebac-40c8-92c2-476db8d523ce) that could check the spelling in SpecFlow feature files inside Visual Studio? I've got ReSharper along with ReSpeller installed, but it does not seem to spell-check anything in my .feature files...
I use Visual Studio Spell Checker for spell checking feature files (note that you can also find it in the "Extension Manager" online gallery).
Here's the description from the website:
This extension provides spell checking support for various "natural
language" portions of files. This includes:
* Plain text files (the entire file is spell checked)
* Source code (comments and strings are spell checked)
* HTML/ASP (things that aren't HTML tags are spell checked)
Custom dictionaries can also be added to spell check in different languages (e.g. OpenOffice versions 2, 3, and 4 dictionaries).
I've not seen one in VS, but that doesn't necessarily mean that is a problem.
Let's consider how you create your scenarios and features. In best practice, these are created from a conversation between the stakeholder and the developer. Think if it, if you like, as akin to pair-programming, this is pair-specification design. This process would start with a verbal conversation and only as we find common understanding do we then reach for a tool to record this.
Since features are just plain-text specification files then there are many tools that can record this. To me, VS feels a little one-sided in favour of the developer. Why not be more partisan and instead use email so you can both use its spell-checker and send both parties a copy of exactly what was agreed upon? Maybe use Word, or any other tool that can save as plain-text.

Handling white space and formatting in source control

I work on a team that uses TFS for source control. Recently some team members are complaining that others are checking in files that have been heavily modified in the sense that the IDE (Visual Studio) has done some sort of automatic formatting on them. This is particularly burdensome on users who make heavy use of the comparison functionality. I am admittedly unfamiliar with the nuts and bolts of Visual Studio. One member has suggested that we all use the same editor settings so that this doesn't happen.
Is having all team members adopt the same code editor settings the best way to handle this problem?
Having everybody use the same settings is a good idea in general. If everybody adheres to the same format, settings, and conventions, then this can help reduce the "learning curve" when switching between code that another person wrote.
That being said, if most of the differences are whitespaces then that may indicate a shortcoming of the diff tool. Fortunately, Visual Studio allows you to swap out the built-in diff tool with something of your choosing. You just have to find one that works best for your needs. KDiff3 is a pretty good one.
Here's an example on how to configure KDiff3 with Visual Studio. There's a setting (possibly a command line parameter) in KDiff that you can set and it will ignore whitespace differences.

Scripting the Visual Studio IDE

I'd like to create a script that will configure the Visual Studio IDE the way I like it. Nothing vastly complicated, just a few Tools/Options settings, adding some External Tools, that kind of thing.
I know that this can be done inside VS with Import/Export Settings, but I'd like to be able to automate it from outside of VS. Is this possible, and if so, how?
Edited to add: doing it from outside of VS is important to me -- I'm hoping to use this as part of a more general "configure this newly-Ghosted PC just the way I like it" script.
Edited again: the solution seems to be to hack CurrentSettings.vssettings, or use AutoIt. Details below.
Answering my own question, in two ways:
In VS2005/8, the things I mentioned (Tools/Options, External Tools) are all stored in the CurrentSettings.vssettings file, in the folder "Visual Studio 200{5|8}\Settings". This file is just XML, and it can be edited programmatically by anything that knows how to parse XML. You can also just paste a new vssettings file over the top of the default one (at least, this works for me).
The larger question of configuring a virgin PC. It turns out that not everything I want to change has an API, so I need some way of pretending to be a user who is actually sitting there clicking on things. The best approach to this seems to be AutoIt, whose scripting language I will now have to learn in my Copious Free Time.
An easy way is to use the macro recorder to do something simple, then look at the code it produces and edit it as you see fit.
On my machine Visual Studio stores it's local settings in a file called VCComponents.dat. Its a text file, so perhaps you could find a way of placing your settings directly in there.
The file is stored in my users local AppData\Local\Microsoft\VC folder

Resources