Frequently Asked Questions
for Version 2.x of Source Insight

Licensing and Prices

Q: What is the price?  Do you have volume discounts?  Do you offer site licenses?

A: We offer volume discounts and group licenses in bulk.  You can get a price quotation from our secure order form.

Q: Do you offer "floating" licenses?

A: We currently do not offer floating licenses, because they require complicated license management.  We do offer group licenses in bulk.  Please email us for details.

Q: Do I need a separate license of Source Insight for each machine in my office?

A: No, as long as you are the only user of all the machines in your office.  The license is intended to be for a single user. 

Q: Do I need a separate license to take Source Insight home and work?

A: No, as long no one else can be using your copy at work at the same time.

Q: I lost my original disk and I can't find my serial number anymore.  What can I do?

A: If you sent in your registration to us, then we will be happy to tell you what your serial number is and send you a replacement disk.  If you did not register with us, we cannot issue replacement disks or serial numbers, unless your company already has a site license agreement with us, or you can provide us with a valid sales receipt or invoice.

System Requirements

Q: What operating systems does Source Insight run on?

A: Source Insight is a Win32 bit program that runs on Windows 95/98/Me and Windows NT 4/2000/XP or greater.  It does not run on Windows 3.1.  We do not have a Unix or a non-Intel WinNT native version.

Opening Files

Q: When I double click on a file icon in Windows Explorer, a new instance of Source Insight opens.  How can I get the existing instance to open the file?

A: You need to add or edit the shell "open" command to invoke Source Insight.

  1. In an Explorer window, select Tools > Folder Options: File Types.
  2. Locate the C File type, or add one.
  3. Click the Advanced button
  4. Edit the "open" shell command to read:

"c:\insight\insight.exe" -i "%1"

Where c:\insight is the directory where you installed Source Insight.  The -i command line option tells Source Insight to send the rest of the command line to an already running instance of Source Insight.  Be sure to surround the %1 with double quotes so that file names with spaces in them are handled correctly.

Custom Commands

Q: When I run a Custom Command that is supposed to capture program output, nothing happens.  What gives?

A: If you are running WinNT/2K/XP and having a problem, then skip ahead to the WinNT answer below.  If you are running Windows 95/98/Me, you may sometimes experience a problem capturing output in a custom command.  When Source Insight launches a custom command, it first redirects the standard output and standard error handles to pipes, which Source Insight reads.  Win95/98/Me seems to handle these pipes differently than WinNT/XP, and because of this, Source Insight does not receive the input it expects.  To confirm that this is the problem, uncheck the "Capture Output" checkbox in the Custom Command dialog box and run the custom command again.  If the command runs normally (except for capturing the output of course), then you have the problem in question.  Here are a few things you can try:

1. Reboot your system.  Sometimes this is all that is needed to get Windows working correctly again.

2. Try launching a batch file instead that calls your program. For example, if your custom command "Run" string used to be "mymake.exe", change it to "command /c mybatch.bat" which will run mybatch.bat.  In mybatch.bat, enter a call to mymake.exe. 

WinNT/Win2000/WinXP and other fixes for Custom Commands:

1. If your program redirects stdout or stderr, this can confuse Source Insight into losing output.  You will have to either remove the redirection, or have your program send its output to a result file.  Then change the custom command to type out the results file.  For example, if the "Run" string in the Custom Command dialog used to say "mymake.exe", then change it to "mymake.exe;type logfile.txt" where logfile.txt is the program output.

2. Make sure the program sihook.exe is in your path or in the \Insight directory (where you installed Source Insight into).  The sihook.exe program is required to launch the custom command.

3. Make sure the correct program is running and the current working directory is correct.  When a custom command runs, the current work directory is not set to anything in particular.  You should put a "cd" command in the Run string before calling your command.  For example, "cd %j;mymake" will change the working directory to current project directory, then run mymake.

4. If your custom command invokes the command shell, make sure on NT that you use "cmd" instead of "command" as the shell program.  For example, instead of "command /c mybatch.bat", use "cmd /c mybatch.bat".

Context Window

Q: My Context Window disappeared and I can't get it back.

A: This may be caused by a corrupted configuration file.  You will have to restart Source Insight without your configuration file.

  1. Run Source Insight, and select Options > Save Configuration. Check to box at the top that says "All settings". Click the Save button.
  2. Note the directory where the Save dialog box opens.  This is the directory where your configuration file is normally stored. It will probably be in a folder such as "My Documents\Source Insight\Settings". Just cancel the dialog without saving.
  3. Exit Source Insight.
  4. Go to the folder found in step#2 above, and find the file called GLOBAL.CF3.
  5. Rename GLOBAL.CF3 to something like OLD.CF3
  6. Run Source Insight again.  All options should be back to the defaults.
  7. Select Options > Load Configuration.  Clear the top check box and turn on all the lower checkboxes except for "Display and Windows".   Press the Load button and select OLD.CF3 to load. This will load all your other settings, except for the positions of the windows.
  8. After loading OLD.CF3 (minus the "windows" settings), your Context Window should be back.  We're sorry for the inconvenience.

Printing

Q: How can I print just the selected text?

A: Source Insight 3.x supports printing the selection by using the "selection" option in the Print dialog box.

Source Insight 2.1 does not support printing the selection only.  You can have this functionality by using this PrintSelection editor macro.  See the macro file for instructions.

Q: How can I print the syntax coloring?

A: Source Insight 3.x support printing the syntax coloring and formatting. Before printing, select File > Page Setup and make sure that the check box that say "Print syntax formatting" is checked. Version 2.x cannot print syntax coloring.

Working with Project Files (Version 2.x specific)

Q: How can I add a whole source tree to my project?

A: Select Project:Add Files.  Change to the top directory you want to add. Check the "Include Subdirs" checkbox and click the "All" button.  This will add the whole subtree starting with the currently displayed directory.

Q: How can I add a single directory to my project?

A: Select Project:Add Files.  Change to the directory you want to add. Un-check the "Include Subdirs" checkbox and click the "All" button.  This will add the the files in the current directory to the project.

If you want to add a series of sub directories, change to the parent directory.  Select a sub directory name in the file list and press the "Single" button.  This will add the contents of the selected directory to the project.  If the "Include Subdirs" checkbox is checked, then sub directories within the selected directory are also added.

Q: How can I add more than one file at a time to my project? Is there a multiple-selection listbox I can use?

A: The current version of Source Insight does not support multiple file selections.  You can either run Project:Add File, select a file and press the "Single" button to add a series of individual files.

Or, you can use the Windows Explorer or Windows File Manager to multiply select files, then drag and drop them onto the Source Insight Project window.  Dropping a file on the Project window will add the file to the project.

Q: How can I delete a bunch of files from my project easily?

A: The current version of Source Insight does not support multiple file selections.  You can run Project:Remove File, select a file and press the "Single" button to remove a series of individual files. 

You can also select a single file and press the Del key to delete it, however only one at a time can be deleted.

If you are trying to delete a set of files with the same extension, for example all *.h files, then you can run Project:Remove File, enter *.h in the input field, press Enter, then press the "All" button to remove all the *.h files.

Q: Is there an easy way to maintain a list of files in the project?

A: The "Add File List" command takes an input text file containing a list of project files and/or directories and ensures they are added to the current project.  This allows you to maintain a list of files that should be used to create a project.

The input file must contain one file per line.  If the file is actually a directory, then all the files in the directory are added to the project.

You can create a snap-shot of your project in a file list file by using the Project:Project Report command.  Select the Project Report command and turn off all checkboxes.  Press OK.  When finished, delete the top and bottom few lines that are not file names.  Then save the report file as your file list file.

Note however, that Source Insight will not remove any files from your project if they do not appear in the file list file.  The Project:Synchronize Files command (and the background processor) will automatically remove files that don't exist anymore on disk.

Document Types

Q: How do I setup Document Options to control parsing?

To check the document options:

1. Right-click on the source file and select Document Options.

2. Note the document type in the upper left of the dialog box.  It should indicate the correct type of source file, for example: "C Source File".  If this is not the case, you probably have the file filter field incorrectly set.  See "How do I setup the Document Option File Filter?".

3. If the document type is correct, look at the Parsing options in the lower left of the dialog box.  The "Stock parser" should be set to the correct language.  If not, select it now.

Q: How do I get Source Insight to recognize my new file type?

See below.

Q: How do I setup the Document Option File Filter?

A: The file filter is what associates a type of file with a document type.

To check the document options file filter:

1. Right-click on the source file and select Document Options.

2. Note the document type in the upper left of the dialog box.  It should indicate the correct type of source file, for example: "C Source File".  If this is not the case, you probably have the file filter field incorrectly set. 

The file filter field should contain one or more wildcards.   The wildcards must be separated by a SEMI-COLON (;).  Do not use a space or comma.  The font used in the dialog box is sometimes hard to see, but check that you do not have a comma instead of a semi-colon.

For example:    "*.c;*.h;*.h2"

Or:    "*.c;otherfile.asm;cmd*.x"

Note that you can used an unambiguous name in the file filter field to override the normal association.

Q: How do I add a new Document Type?

A: You need to use the Document Options command.

1. Select Document Options from the Options menu.

2. Select the "Plain Text" document type from the dropdown list at the upper left.

3. In the "Name" field, type the new name for the document type. 

4. In the file filter field, enter a wildcard that describes the file type. See: How do I setup the Document Option File Filter?

5. In the Parser section, set the "Stock Parser" to "None".

6. Set all other document options the way you want it.  

7. Optional: you can enter a single regular expression that can be used to parse symbols from your file if a built in parser does not exist.  To see an example, select the "INI File" document type.  In the "Custom Tag Type" list, select the type of symbol you intend to parse.  For example, "Function".  In the "Custom Pattern" field below it, enter the regular expression that parses it out.  See the online help file topic "Document Options".

8. Press the Add button.  If you don't see an Add button, then the document type name you entered already exists.  The Add button will change to read "Change" if the document type name you entered already exists.   Make sure you don't inadvertently change an existing document type.  Also make sure you don't change the "Default" document type by mistake.

Parsing Files

Q: Can I add my own language parser?

Source Insight 2.x does not allow you to add a new language.   However, you add some support for your file type by using the Document Types feature.  See below. Version 3.x does support adding custom languages.

Q: How can I add my own parsing?

A: While Source Insight does not allow you to add a completely new language, through the use of Document Types you can set it up to use a regular expression pattern to parse symbol definitions out of your files.

1. Create a document type to associate with your file type. (See How do I add a new Document Type?)

2. In the Parsing section of the Document Options dialog box, select the type of symbol you will be parsing out from the Custom Tag Type drop-down list. You are only able to parse a single type of symbol using this technique. You will need to decide what is the most important type of thing you want to navigate to in your file. For example, that may be a "Function".

3. In the Custom Pattern field, enter the regular expression you want to use. The expression must contain 1 regular expression "group", which encloses the symbol's name. A group is surrounded by \( and \). For example, if a typical function definition looks like this:

    My_Func(function_name) .....

Then you could use this regular expression:

    My_Func(\(.*\))

which says that the string of characters between the parentheses is the name of the symbol that will be entered into the symbol database.

4. Press the Change button and then close the Document Options dialog box. All open source files will be re-parsed.

Finding Symbols

Q: Jump To Definition says "Cannot find <symbol>"

Q: I have a source code file open, but the symbol window (on the left side) does not show ANY symbols.

A: See: How do I setup Document Options to control parsing? 

If the document options are correct, then there is probably a parsing problem.  See "Source Insight wont parse my file".

Q: I'm looking at a symbol definition in the source code and the symbol window (on the left side) does not show its definition.

A: See:  Source Insight wont parse my file 

Q: Source Insight won't parse my file.

A: There are various reasons why Source Insight may fail to parse your file.  Things to keep in mind are:

1. C Preprocessor macros are not expanded before parsing.   If you have a weird macro that expands to be part of a definition, then it's quite possible that Source Insight will be confused.  Also, extraneous tokens that are #defined to white space can confuse the parser.

2. Using #ifdef/else/endif to split up a definition will sometimes confuse Source Insight.

3. Check that the correct document options are set.   See "How do I setup Document Options to control parsing?"

4. If you don't know what bit of code might be confusing Source Insight, try bi-secting your source file until symbols show up in the symbol window.  Select the top half of your file and delete it.  Keep doing that until some symbols show up.  Once symbols show up, you know the chunk you just deleted contained something that affected the parsing problem.  Note that text before (sometimes way before) a particular declaration can affect how it is parsed.

Q: Source Insight wont find symbols on the Project Symbol Path.

A: The project symbol path allows you to use the "Jump to Definition" command and to have the Context Window show definitions for symbols that are in the project symbol path (if they are not already in the current project).   We will use the term "common project" to mean a project, other than the current project, that is on the symbol path.

Things that don't work with the project symbol path:

1. If you are typing in a name, only symbols in the current project are partial-matched while you are typing.

2. The Look Up Reference command only works on files in the current project.

3. Source Insight will only allow one program instance to access a project at a time. If another instance has the common project open, SI will silently skip over that project if it is on the project symbol path.

4. Projects that are not currently open are not synchronized with file changes in the background.  If your common projects files change, you need to explicitly open them once in a while to get them synchronized.

If you are still having a problem, try this:

1. Open the common project (the one on your project symbol path) and run the Project->Synchronize Files command. This will ensure that the whole project is parsed and symbolic information is saved for the project.

2. Next, use the Search->Browse Global Symbols command to locate the symbol you think should exist in the common project. 

If you cannot find the symbol in the common project while the common project is open, then either the symbol's file is not added to the project or the file is not being parsed for some reason. 

If the symbol is found in the common project, then return to the other project and see if you can use the "Jump to Definition" command to find the symbol.

General Problems

Q: Source Insight just crashes or exits when I start it.

A: Here are a few things to try:

1. If possible, it would be good to reboot your system and try it again. A system resource may be locked or in low supply.

2. If that didn't work, quit SI and go to the directory where you created your current project. Find the file called <projectname>.WK - this is the workspace file associated with the project. Delete that file or rename it for later. Start SI again and see if that fixed it.

3. If that didn't work, quit SI and go to the directory where you installed Source Insight. Find the file called GLOBAL.CF - that is the configuration file that contains your customizations. To start SI in a default state, rename it to something like OLD.CF. Start SI again and see if that fixes it . If it did fix it, you can try reloading some of your customizations again using the Options: Load Configuration command and loading portions of OLD.CF.

4. If that didn't work, you may have a bad project state. Quit SI and run it from the command line like this: insight /pc

this runs SI but does not open the current project. If this works okay, then there must be a problem with the project. If you open the project using the Open Project command and it crashes, that confirms it. If that is the case, it would be best to re-create the project.

Editing Operations

Q: Why does Source Insight warn about non-ASCII characters when I save a file containing non-English characters? 

A: This warning in version 2.x has been removed in a maintenance release.