• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter FOUR. Advanced Page Editing > TIP 78: Automating Code Completion and Ad...

TIP 78: Automating Code Completion and Adjusting Settings

We have, on occasion, made a typo or two when editing source code and then spent ages trying to find what we'd done wrong. Not to worry—code completion in GoLive CS2 allows even the most abysmal typists to turn out perfect pages.

Any Flavor Will Do

The code-completion feature is context sensitive, so if you're working in PHP it will display the appropriate list of elements for PHP, and likewise for JavaScript.

In GoLive's Source Editor, type an opening bracket. As you do so a list pops up, displaying a full set of tags appropriate for the type of syntax you're working with (Figure 78a).

Figure 78a. With code completion enabled, a list of tags you can pick from appears as you type source code.

If you type the first letter of the tag you want to use, the list will jump to the tags beginning with that letter. You can scroll the list using the up and down arrows on your keyboard and you can select a tag by pressing Return/Enter or by double-clicking the tag. Doing so writes the tag into the code. As soon as you type a space to continue, the list of attributes for that tag will appear. Again, simply navigate the list and make your selection.

Code-completion is turned on by default, but you can disable it if you'd like or set options for how it responds. To set the code-completion options, choose GoLive > Preferences on Mac or Edit > Preferences on Windows and then select Syntax under the Source preferences (Figure 78b).

Figure 78b. Disable or customize the code-completion features in the application preferences.

Disabling Code Colorization

To turn off code colorization, click the Colorize Code button in the Source Editor. This is a sticky setting, meaning that if you turn it off on one page, it will be turned off on all pages, including the Source view in the CSS Editor, the Split Source view, and the JavaScript Editor.

Choosing Enable Immediate Completion will insert the necessary end tags into the code. Selecting Balance While Typing automatically jumps you to the next open bracket as soon as you type a closing bracket. You can also decrease the delay of the pop-up list by dragging the slider toward zero.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint