Oracle® Solaris Studio 12.4: IDE Quick Start Tutorial

Exit Print View

Updated: October 2014
 
 

Using Code Completion

The IDE has a dynamic C and C++ code completion feature that enables you to type one or more characters and then see a list of possible classes, methods, variables, and so on that can be used to complete the expression.

  1. Open the quote.cc file in the Quote_1 project.

  2. On the first blank line of the quote.cc file, type a capital C and press Ctrl-Space. The code completion box displays a short list that includes the Cpu and Customer classes. A documentation window also opens and displays the message No documentation found because the project source code does not include documentation.

  3. Expand the code completion list by pressing Ctrl-Space again.

    image:Code completion list
  4. Select a standard library function such as calloc() from the list and the documentation window displays the man page for the function if the man page is accessible to the IDE.

  5. Select the Customer class and press Enter.

  6. Complete the new instance of the Customer class by typing andrew;. On the next line, type the letter a and press Ctrl-Space. The code completion box displays andrew. If you press Ctrl-Space again, the code completion box displays a list of choices starting with the letter a, such as method arguments, class fields, and global names, that are accessible from the current context.

    image:Code completion list
  7. Double-click the andrew option to accept it and type a period after it. You are automatically provided with a list of the public methods and fields of the Customer class.

    image:Code completion list
  8. Delete the code you have added.