Search Project

Searches for text or keywords across all project files. This command works the same as the Lookup Refer­ences command. The only difference is that each dialog box has its own persistent state. See: Lookup References.

You can also use the Project Search Bar to perform the same type of search. See: Project Search Bar.

Search Project Dialog

inset_98.jpg

 

For details on the basic options in this dialog, See: Lookup References.

Keyword Expressions

A keyword expression search is similar to an Internet search engine query. Source Insight searches the proj­ect for occurrences of a set of keywords that appear within a specified number of lines. The Lines of Context text box indicates the maximum distance the keyword terms can be from each other to qualify as a match.

For example, if you typed "cat food", then Source Insight will search for occurrences of "cat" and "food" within X lines of each other.

There is an implicit logical-AND operator between keywords. That is, if you type more than one keyword, the both keywords must be present to qualify as a match. You can include other Boolean operations as well. The following table lists the operators available:

Table 4.6: Keyword Search Operators

Operator

Example

Action

AND or +

cat and dog

Both terms must be present.

OR

cat or dog

Either term must be present

NOT
or –
or !

-cat

The term must not be present

=

=Betty

Case sensitive match

? "regexp"

? "^Ich"

Term is a regular expression

You can also group expressions using parentheses. For example:

(cat or kitty) and food

(file or buffer) and (save or write) and !error

Word Variations

If you enabled the Find word variations option, then Source Insight will also find different ending forms of the keywords you specified. For example, if you specified the keyword "open", Source Insight will also find "opens", "opened", and "opening". This has the same effect as typing this expression:

(open or opens or opening)

Word variations are applied to each keyword term. For example, if you specified:

save write

Which implies "save" and "write" must be present. With word variations enabled, this search would be equiv­alent to:

(save or saves or saving) and (write or writes or writing)

Find Word Fragments

If you enabled the Find word fragments option, then Source Insight will search for name or word fragments. For example, if you specified the keywords "open doc", Source Insight will match occurrences of identifiers such as OpenDoc, DocumentOpen, IsDocthingOpened, etc.

This is very powerful type of search. If your project uses fairly consistent naming conventions, you can search for combined references to multiple subsystems.

Some examples:

Find String

Typical Matches

open

DocOpen, HTMLOpen, FileOpenReadWrite

ip open

IpOpen, OpenIp, OpeningIp, IpsecOpen

doc save remote

SaveDocToRemote, IsDocSavedOnRemote

Keyword Search Results

When you perform a keyword search, the Search Results will list blocks of lines that include the keywords together.   This gives you a little bit of context around the matches.