Sahi Pro - Eclipse configuration for Intellisense and Syntax Highlighting in Sahi scripts


You can use Notepad++ or any text editor to write your sahi scripts. But if you want to use Eclipse as the editor, you can follow these steps to configure Intellisense and Syntax Highlighting.

The steps have been documented for Eclipse Indigo version.

  1. Open Eclipse.
  2. Ensure that the JSDT Eclipse plug-in has been installed. Click on Help | About Eclipse SDK | Installation Details.

    Eclipse Installation Details
  3. If not installed, click on Help | Install New Software. Use the settings displayed in the image below.
    If you are using an older version of Eclipse, you should see a corresponding update site in the Work with dropdown box.
    Install New Software
    Proceed with the installation.
  4. Click on Windows | Preferences | General | Content Types
  5. In Content types: section, select Text | JavaScript Source File and then in File associations: section, click on Add.
  6. Make association for *.sah and click Ok.

    Make Sahi Association
  7. Now that the file association has been done, create a Java Script Project from existing source with the directory as your scripts folder, typically <SAHI_INSTALL_DIR>/userdata/scripts folder.

    Create Javascript Project
  8. If you do not have apis.sah in the project scripts directory, download apis.sah from http://sahi.co.in/static/apis.sah and copy it into the project scripts directory.
  9. Open any .sah file from the JavaScript project, and you should now be able to see syntax highlighting.

    Type the first few letters of a function and press Ctrl + Space to bring up template proposals.

    View Intellisense