Sourcesafe searching - visual-sourcesafe

I need to do a significant search through my SourceSafe 8 database to support a refactoring exercise.
I have a list of about 250 differant stored procedures that are called and need to work out where in the application. Are there any tools that improve on the standard search so that I can search for any instance of any of these procs or is pulling the code into another database my best bet ?

Don't laugh but I still use SourceSafe 6... but there is a Find in Files option from the tools menu that will do a search within files for a specific string... do you have that available in version 8?

You may try vssfind utility, a freeware, and see if helps.

With Microsoft Visual SourceSafe Explorer Version 8, the View/Search menu provides access to the following search capabilities:
Wildcard Search (On the file name. Use a question mark to match a single character in the file name, and an asterisk to match zero or more characters.)
Search Area
Search in current project only
Search in current project and all subprojects
Search in all projects
Status Search
Display all checked out files
Display files checked out to: [user name]
Search Area
Search in current project only
Search in current project and all subprojects
Search in all projects
For the first two Search Area options, the search settings will be applied as you click from project to project. Remember to go back and clear your search settings after you've found your files of interest.

Related

Visual Studio Extension to modify the Go to All search results?

Would it be possible to create an extensions that modifies what appears in the Go to All search results of Visual Studio 2017? I'd like to build an extension that lets the user (within Tools -> Options...) define any number of glob patterns for paths that should be excluded from this search. If it's possible could anyone point me in the right direction on what APIs to use?
The extension could either use the globs to instruct VS to filter what locations are searched, or it could receive the results and remove the unwanted ones before they are displayed - depending on what APIs are available.
This would for example be useful when you're working with a typescript project that compiles into js into some other folder, but you only want to search your ts files, or even more if you're working with some framework where html files are copied from the location where you code them to the location(s) where they need to be when running the app(s).

How can you open two different historic versions of same solution in two separate instances of Visual Studio?

How can you open two different historic versions of same solution in two separate instances of Visual Studio? (VS2012)
What I need to do is look at the whole solution for a point in time so I can use "find all references", which you cant do when viewing a single file from a changeset.
If you get the whole codebase for the changeset you require then you overwrite the current code base (as both code bases sit on same location on your local file system) and lose ability to cross reference you current code with the historic version.
Is there a way I can view both current and historic versions of code in Visual Studio (same or different instances) and still be able to use find all references in both versions of the code?
You will need to
Pull the first version using the "Get Specific Version" right click option within Source Control Explorer
Copy the files from your local path to a different path
Pull the second version
Open two instances of VS each pointed to the appropriate folders
Its not pretty but it works.

Unlock Xcode Project File for Find and Replace

I make common use of Xcode's workspace Find and Replace. It's very powerful when combined with regex.
However, I've got a workspace with 30-40 projects and a large change to the build settings has just been required. I expected to hop into Xcode, and put some regex to use to change the build setting for all projects when I was hit with a block. All my Xcode project files are locked. So the regex find works great, but I have no way of replacing. I can't even preview it. It is only affecting project files that I can see. I opened Finder to check permissions and they are wide open and the OSX file lock is off on all of them. So this seems to be an Xcode locking issue. I tried to lock/unlock the project files the way you would a normal file (File > Unlock...) in Xcode but these options are grayed out for projects.
Anyone encounter this before? Any possible solutions before I have to hand update build settings for 30+ projects?
I did some more digging on this question to confirm or refute my hypothesis from the comments above. Xcode does indeed work directly against the on-disk data for the files involved in find/replace activities. Filesystem events suggest that the find/replace operation opens the .pbxproj file and begins regex activities from top to bottom working through the file and group references to the build configurations and settings sections ultimately applying the search to the on-disk data pointed to by each of the entries in the .pbxproj
Naturally, depending on the regex the user enters, it would be entirely possible to match content exactly at the cursor's current location in the search and trigger a replacement operation that would destroy the current search's context. This would have the most likely effect of terminating the search prematurely, but could also trigger an infinitely long find/replace operation (ex. find '.' replace with 'aa') if the search wasn't well contained. To stem off the entire class of 'self eating snake' problems when it comes to this Xcode find/replace behavior, it seems that Apple has elected to lock the .pbxproj for the duration of the search operation. While this does mean that you can't use Xcode's Find/Replace regex tools, there are a number of great text editors out there (even free ones!) that allow you to do regex find/replace via a Multi-file search (TextWrangler and BBEdit). These editors allow you to filter your search to a file pattern (say *.pbxproj) in subfolders of your master project. Depending on how your projects are organized on disk, pick a search starting at a common ancestor and you can walk your way through the find/replace operation just as you would in Xcode. In fact, the same regex strings you identified in Xcode can be used in these tools to affect the change(s) you need.
As with most massive or autonomous edits, make sure you keep backups of the files you intend to edit (this goes at least doubly so for you since your projects are entirely local, non-source controlled projects) just in case you need to rollback your changes. Good luck and let us know which avenue you wound up taking and how things went.

Find in Files or Quick Find in VS 2008 seems to only work sometimes?

I am working on a project using VS 2008, containing MANY files within projects
within solutions. We recently had to convert all our work from VS 2003 to 2008 (you know
how big companies are always the last to convert to the lastest version of stuff).
In trying a "Find in Files" (or "Quick Find") within 1 solution containing 3 projects, I am successful in my search within all 3 projects only when using "Current Doc" & "All Open Docs". But when using "Entire Solution" or "Current Project" only 2 of the 3 projects give me correct results. The Find will not show files within 1 project in particular that I KNOW include results from my Find.
After reading suggestions from:
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=105511
I attempted every Workaround they had, and NONE worked for me. Any suggestions???
Setting find options
First try the following:
Ctrl+Shift+F (Find In Files)
Look in: Entire Solution
Expand Find Options
Whatever for Match case
Whatever for Match whole word
Uncheck "Use:"
Look at these file types: *.*
"Dealing" with some rare solution hierarchy issues
Next, if you have your projects organized into solution folders (as in you have this instead of this), try expanding each of the projects one time, as follows:
foreach solution folder in the project
expand the solution folder
foreach project in the solution folder
• expand the project node
• (optional) collapse the project node
(optional) collapse the solution folder
Additional details regarding expanding the projects: in my work on my Solution File List tool pane (in particular the Find in Solution Explorer feature shown), I found that sometimes files aren't found in the solution if the project hasn't been expanded once. Using the automation model, the problem always occurs, but using the lower level COM interfaces is more likely to work. The lower level interfaces are what Visual Studio uses internally, so most of the time people won't run into this problem. I use a lot of carefully ordered operations (aka hacks) to keep it working as much as possible, but every once in a while I still have to expand a folder before a file is found.
If all else fails
I'll need to know as much of the following as you can provide. These are relevant for all projects in the solution, not just the ones that aren't working for the Find in Files. For some Visual Studio operations, an exception will interrupt the remainder of the operation, so an exception while operating on project A might keep the find from reaching project B, etc.
What project types do you have in the solution? Especially if you are using 3rd party project types such as VS.Php (I think .phpproj) or nFringe (.ucproj). As a quick check, you can right click each of those projects and select Unload Project, then try the Find In Files afterwards.
What source control system are you using?
Do you have any 3rd-party add-ins installed? (Microsoft ones count if they are power toys, etc.)
Do you have any non-file-system files in the project? (Nodes in the project that don't map directly to a file on the hard drive.)
Does any project in the solution reference files on the network?

How to search Jar files using Windows Search?

I believe back when we were on Win2K, Windows Search would search through Jar files to locate specific classes but this doesn't appear to work in XP. Does anyone know how to enable this in XP?
Note, to do the search in Win2K we just entered *.jar for the files and "ClassABC" for the search text string and the search would return any jar files containing class files where the title contained "ClassABC".
Add this to a text file, save file, change the extension to .reg, double click to add to registry and you should be ok...you can search on file name or content and it should show jars that have class names
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.jar\PersistentHandler]
#="{5e941d80-bf96-11cd-b579-08002b30bfeb}"
The only thing left is to logout and log back into windows and it should work fine for you, see http://support.microsoft.com/kb/309173 for more details
I would also recommend total commander. It is a great file management tool with great search functionality which can easily look inside jar files.
If it was removed it was likely due to the Sun-Microsoft Java dispute that was going on around the time XP was developed. It's unlikely to have a way of re-enabling it.
You might find this helpful instead: http://jarbrowser.sourceforge.net/
Just use FindClassInJars util, it's a simple swing program, but useful.
You can check source code or download jar file at http://code.google.com/p/find-class-in-jars/
I made another version of FindClassInJars here. It is the same look but searches a little better and smarter. Click the "Raw button here:
https://github.com/Oxvalley/FindClassInJars/blob/master/lib/findclassinjars-2.0.0.jar
According to this MSDN Channel 9 article, adding an appropriate IFilter will do it. Since .jar files are the same as .zip files, one of the four ZIP file IFilters they list might work (unless they are all extension-based).
From Brenden Anstey's Blog:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.jar]
"Content Type"="application/x-zip-compressed"
"PerceivedType"="compressed"
#="CompressedFolder"
[HKEY_CLASSES_ROOT\.jar\CompressedFolder]
[HKEY_CLASSES_ROOT\.jar\CompressedFolder\ShellNew]
"Data"=hex:50,4b,05,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
[HKEY_CLASSES_ROOT\.jar\OpenWithProgids]
"CompressedFolder"=""
[HKEY_CLASSES_ROOT\.jar\PersistentHandler]
#="{098f2470-bae0-11cd-b579-08002b30bfeb}"
[HKEY_CLASSES_ROOT\.war]
"Content Type"="application/x-zip-compressed"
"PerceivedType"="compressed"
#="CompressedFolder"
[HKEY_CLASSES_ROOT\.war\CompressedFolder]
[HKEY_CLASSES_ROOT\.war\CompressedFolder\ShellNew]
"Data"=hex:50,4b,05,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
[HKEY_CLASSES_ROOT\.war\OpenWithProgids]
"CompressedFolder"=""
[HKEY_CLASSES_ROOT\.war\PersistentHandler]
#="{098f2470-bae0-11cd-b579-08002b30bfeb}"
[HKEY_CLASSES_ROOT\.ear]
"Content Type"="application/x-zip-compressed"
"PerceivedType"="compressed"
#="CompressedFolder"
[HKEY_CLASSES_ROOT\.ear\CompressedFolder]
[HKEY_CLASSES_ROOT\.ear\CompressedFolder\ShellNew]
"Data"=hex:50,4b,05,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
[HKEY_CLASSES_ROOT\.ear\OpenWithProgids]
"CompressedFolder"=""
[HKEY_CLASSES_ROOT\.ear\PersistentHandler]
#="{098f2470-bae0-11cd-b579-08002b30bfeb}"
I know that it's not Windows Search, but I have long used Agent Ransack for this: it is very quick and searches through all the various java archive formats (jar, war, ear) as well as zip.
A feature that I particularly like and use a lot is saving a search: you can save the criteria (so that you can repeat that search easily) or the results.. So when I am working on a project, I will often want to search through the project directory tree for a file (or a file within a jar/zip). I perform the search once and save the criteria as a .srf file, which I can open quickly to perform similar searches afterwards.
As suggested by #iubing, the FindClassInJars code works fairly well, but the author must have botched the packaging.
I've forked the FindClassInJars util from google code, you can get a built copy here that works. Just click the "raw" button.
a while back I developed this: https://github.com/javalite/jar-explorer just for the occasion. works even on windows :)

Resources