What's New in Oracle® Solaris Studio 12.4

Exit Print View

Updated: December 2014
 
 

Code Assistance Improvements

The IDE provides many improvements in code assistance, including the following:

Code Assistance Cache Sharing

When parsing C/C++ source code, the IDE stores parse results on disk in the Code Assistance cache. When you open a project the IDE examines the cache to see if it is up to date. If the cache is up to date the IDE does not parse your project and just loads the required data for code navigation from the Code Assistance cache.

By default the Code Assistance cache resides in the ${userdir}/var/cache folder, where ${userdir} stands for the IDE user directory. The user directory in Oracle Solaris is in the user's $HOME/.solstudio/ide-<release> . The cache in the user directory cannot be shared or copied to another location.

However, if the Code Assistance cache is placed inside a project, it can be copied to another computer if that computer meets the following requirements:

  • The computer's operating system is identical to the operating system where the code was parsed

  • The tool collection used by the project is available in the same location on the computer

To instruct the IDE to place the Code Assistance cache inside your project metadata:

  1. Add a line "cache.location=nbproject/private/cache " to either:

    • The project properties file (nbproject/project.properties)

    • The private properties file (nbproject/private/private.properties)

    The difference between the project properties and private properties files is that the public one (nbproject/project.properties) is shared in the IDE via version control system by default, while the private one (nbproject/private/private.properties) is not. So if you modify private properties, you will need to synchronize the private properties file with the identical file on another machine. If a project properties file is modified, a version control system can automatically synchronize it with the one on another machine for you.

  2. After the properties file is modified, close and reopen the project.

    The IDE parses the project and the Code Assistance cache is placed into a private subdirectory in the project metadata.

  3. Close the project and archive your nbproject/private/cache or copy it to a shared location.

    If you do not close a project before copying or zipping, some data will not be flushed to cache.

The Code Assistance cache can be copied to other projects on other machines and be used instead of waiting until the IDE parses the project. If there are some newer files on the machine the cache is being copied to, only newer files are going to be parsed.


Note -  If the Code Assistance cache needs to be shared between machines that run different operating systems or different compilers, you must create a separate cache for each combination of operating system and compiler collection.

New Project Properties Options for Code Assistance

For projects created from existing sources or from a binary, the IDE now provides the following project properties to make it easier for you to use the projects in version control systems.

Transient macros

You can provide a list of macros (-D options) that are volatile -- they depend on time, date, or specific environment. These macros values will not be stored with the project's public metadata.

User Environment Variables

You can provide a list of environment variables that the project uses to pass system-specific paths. These macros environment variable values will not be stored with the project's public metadata. For projects from existing code or from binary, you may specify the list of environment variables to be used when storing project metadata. When the IDE stores the compiler options and an option value coincides with a variable value, a macros will be written instead.

Search file system for C/C++ header files

If you create a project from existing sources where the sources have not been built and does not contain any debugging information, the IDE may have trouble configuring code assistance. In this case, you can specify in the Configure Code Assistance wizard to use a special mode, Search file system for C/C++ header files. In this mode, the IDE tries to resolve failed include directives by searching the file system for headers. The wizard asks you to enter the path to search for headers. By default, the path is the project source root.