LabWindows/CVI User Group Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

LabWindows/CVI Tip: New Source Code Browse Features

Contents

  1. Overview of the New Source Code Browse Features
  2. Understanding the New Icons in Show Completions
    1. Using the Show Completions List
  3. New Options for Source Code Browse Settings
  4. Reasons to Customize Source Code Browse Settings

Overview of New Source Code Browse Features

LabWindows/CVI 2013 offers a richer programming experience that provides users with better control, navigation, and knowledge of their source files. Programmers can view and jump to functions in a source file by using a pull-down list in the toolbar of the Source window.

In addition, source code browse information can be generated while editing a file so that developers can immediately navigate code while programming without the need to compile first. This option no longer applies per-configuration-per-workspace, but is now global to LabWindows/CVI. Source code browse information is available in release and debug configurations.

Function Pull-down List

Source code navigation is made easier through the function pull-down list in the LabWindows/CVI 2013 toolbar.

Function_pull_down_list.png

Understanding the New Icons in Show Completions

In LabWindows/CVI 2013, the following icons are displayed to represent a listed symbol in the Show Completions list so that you can quickly identify the type of the element you are selecting.

Source_Code_Browse_Icons.png

Using the Show Completions List

Select Edit»Show Completions or press <Ctrl–Space> to view a list of potential matches for the function or variable you are typing. You will see a drop-down list of symbol names, and associated graphical icons, that begin with the letters you typed. The drop-down list also contains all functions in any functions panels that you have loaded. Show Completions also lists members of a syntactically correct struct, enum members, and macros. If you enable the Show function prototypes and struct/union fields while typing option in the Editor Preferences dialog box, LabWindows/CVI shows struct members when you type . or –> after a variable name.

  1. Select Edit»Show Completions or press <Ctrl–Space>
  2. Use the arrow keys to navigate through the list
  3. Press <Enter> to insert a symbol in your code.
  4. Press <Esc> to close the Show Completions list.

function_auto_complete.png

New Options for Source Code Browse Information

In LabWindows/CVI 2013, source code browse information can be generated while editing a file so that developers can immediately navigate code while programming without the need to compile first. By default, the source code browse information is now generated as soon as you load a project. Subsequent generation occurs on edit, on compile, or on save, depending on which of the following options you select. Users can now define at what point LabWindows/CVI regenerates source code browse information by changing the Generate browse information policy in Options»Environment.


  • Disabled—LabWindows/CVI never generates source code browse information.
  • On edit—LabWindows/CVI generates source code browse information when a file is being edited. This is the default setting. LabWindows/CVI might not be able to generate complete source code browse information if there is a compile error in the code.
  • On compile—LabWindows/CVI generates source browse information when the file is compiled. LabWindows/CVI might not be able to generate complete source code browse information if there is a compile error in the code.
  • On save—LabWindows/CVI generates source code browse information when a file is saved.

Reasons to Customize Source Code Browse Information Settings

LabWindows/CVI uses source code browse information to generate help from source code and to populate the Show Completions list, the Show Prototype tooltip, and the information in the Source Code Browser among other things. Generating source code browse information for large projects can cause LabWindows/CVI run out of memory. When this happens, LabWindows/CVI detects that generating source code browse information caused a problem, displays a warning dialog box, and disables the generation option. Because browse information is no longer generated, you cannot complete tasks that rely on source code browse information.

If you encounter this issue, complete the following steps:

  1. If possible, re-architect your project so that it is smaller. Some ways you can make your project smaller include breaking it up into multiple DLLs and ensuring that your source files include only necessary header files.
  2. When you have a smaller project with which to work, re-enable the Generate browse information policy option in the Environment Options dialog box and restart LabWindows/CVI.

Did you find this tip useful? Rate this document or add a comment below.

If you give this a try, share your experience! Add a comment below.

National Instruments
Comments
cvier
Member
Member
on

Good article for the additional feature.

Contributors