Adding Files to a Project

After you create a project, you next need to add source files to the project. There are several ways to add files.

If you created a new file in Source Insight and save it for the first time, Source Insight will ask you if you want to add the file to the current project. This will be the most natural way to add a file if you are writing new code and are creating new source files a lot.

If you already have existing source files and you want to add them to the current project, use the Add and Remove Project Files command. This command adds any existing files, including whole directory trees, from anywhere on your disk to the current project. See: Add and Remove Project Files., and Add File List.

You can also add files to the project by dragging files from Windows Explorer and dropping them onto the Project File List panel. The Project File List panel also allows removing files from the project.

You can also use Master File List to maintain the files in your project. This is useful for maintaining projects on separate machines and with other team members. See: Using a Master File List.

Adding a file to a project has the following effects:

What Files Should You Add to a Project?

Source Insight projects should consist of program source files and text files only. It doesn't make any sense to add a binary format file to a Source Insight project. For example, adding an exe or bitmap file to your project would have no benefit.

The file types that are defined by default in Options > File Type Options correspond to the types of source files you probably want to use with Source Insight. Normally, only those types of files should be added to a project.

Use File Type Options to control what types of files are added to projects

The File Type Options dialog box contains the check box: Include when adding to projects. You can use this check box to control what file types Source Insight will automatically add to your project, or what file types will be displayed in the list box in the Add and Remove Project Files dialog box.

Adding Remote Network Files to a Project

For whatever reason, you may want to access your source files directly on a network server, not from local copies of the files. Of course, you are free to open any file on the network directly. However, keep in mind that you may be locking other people out of the file by having it open, or otherwise causing contention over the file. In addition, you won't get the benefit of Source Insight's project features unless the remote file is added to your project.

One way to have a project that refers directly to files on the server is to create a project locally on your work­station and add the files from the remote server to your project using the Add and Remove Project Files com­mand. This way, the Source Insight symbol database files are stored locally on your machine, but the source files still reside on the server. See: Add and Remove Project Files.

Using the Project Settings command, you should specify the remote source code directory, on the server, as the project source directory. That way, files will be displayed relative to the main source directory, not rela­tive to your local project data file directory. See: Project Settings.

Project Master File List

Instead of adding and removing files manually through the Add and Remove Project Files command, you can setup a special file called a Master File List and associate that with the current project. For more information, See: Using a Master File List.