|
One of the most powerful parts of the STWorkbench integrated development environment is the built-in editor. This code editing tool has the following extra features useful in code development. RefactoringThis allows you to change the names of variables or functions throughout your projects in one simple operation. To carry out a refactoring operation:
There is a single level of refactoring undo or redo which can be launched from the main or popup menus, or the key combination CTRL + Z.
Local HistorySTWorkbench records the changes made on all files each time they are saved. You can see what changes have been made on an individual file or roll back to an earlier version. To see the changes to a file, in the Editor, Project or Navigator views, right-click the file and select Compare With > Local History. A list appears showing all the file save points by date and time in the top section and shows a difference view between the current version and the selected local history version. To compare two files, in the Projects or Navigator views, right-click two files (they do not need to be in the same project) and select Compare With > Each Other. A window appears in the Editor view showing a line-by-line comparison.
To roll back and replace a file with an earlier version, in the Projects or Navigator views, right-click the file and select Replace With > Previous from Local History. This replaces the current version of the file with the previous saved version. If you select this again it swaps back to the current saved version, allowing a fast toggle between the two last saved versions. To check your current version against the saved versions, compare the differences and then choose whether to do a replace or not, select Replace With > Local History. Note: To configure the amount of data storage used for the local history facility, select Windows > Preferences, then select General > Workspace > Local History. This shows settings for the maximum number of days to keep files, the maximum number of entries per file, and the maximum file size. Content AssistContent Assist provides symbol completion, and a set of templates to speed up the process of code creation. Symbol completions allow auto-completion of function and variable names from your code, and the templates include most of the common C/C++ code constructs such as for loops, if and switch statements, and structure and class definitions. The templates are completely configurable by the user and new ones can be easily added. They contain a range of variables which are either filled in by the user (such as the counter variable in a for loop) or can be completed automatically by the system, such as the date or the current user ID. To edit templates and insert them into code:
|
|||||||||||||||||||||
|
||||||||||||||||||||||