About code hints

Code hints are menus that Dreamweaver opens when you type certain character patterns in the Code view. Code hints offer a typing shortcut by providing a list of strings that potentially complete the string you are typing. If the string you are typing appears in the menu, you can scroll to it and press Enter or Return to complete your entry. For example, when you type <, a pop-up menu shows a list of tag names. Instead of typing the rest of the tag name, you can select the tag from the menu to include it in your text. Dreamweaver also provides code hints for the Spry framework.

Dreamweaver loads code hints menus from the CodeHints.xml file and any other XML files in the Configuration/CodeHints folder. You can add code hints menus to Dreamweaver by defining them in your own XML files using the XML schema format described in this topic, and placing them in the Configuration/CodeHints folder.

After Dreamweaver loads the contents of a code hints file, you can also add new code hints menus dynamically through JavaScript. For example, JavaScript code populates the list of session variables in the Bindings panel. You can use the same code to add a code hints menu, so when a user types "Session." in Code view, Dreamweaver displays a menu of session variables. For information on using JavaScript to add or modify a code hints menu, see “Code Functions” in the Dreamweaver API Reference.

Dreamweaver cannot express some types of code hints menus through the XML file or the JavaScript API. The CodeHints.xml file, the SpryCodeHints.xml file, and the JavaScript API expose a useful subset of the code hints engine, but some Dreamweaver functionality is not accessible. For example, there is no JavaScript hook to open a color picker, so Dreamweaver cannot express the Attribute Values menu using JavaScript. You can only open a menu of text items from which you can insert text.

Note: When you insert text, the insertion point is placed after the inserted string.