Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Features

Andrew Eisenberg edited this page Oct 4, 2012 · 23 revisions

This page gives an overview of all the features in Scripted.

Navigation and Search

Scripted provides several ways to navigate and search your project for content.

Outline view

The outline view is a dialog containing list of all functions in the current JavaScript file. You can use this to navigate to the declaration of any one of these functions. Typing will filter the list.

The outline view

You can open the outline view by typing Ctrl/CMD+Shift+O.

Find file

The find file dialog allows you to search for and open files inside of your project.

The find files dialog

You can open the find file dialog by typing Ctrl/CMD+Shift+F.

Search files

The search dialog allows you to grep through all files in your project for a particular string.

The search dialog

Navigator

Scripted uses a standard file navigator on the left-hand side that lists all files in the project and allows quick navigation to them.

Breadcrumb

Above the editor is a breadcrumb that shows all parent directories of the current file and allows quick navigation to any file in one of those directories.

History

That strange icon to the left of the breadcrumb is the history navigator. It lists all recently visited files and allows quick navigation to any one of them.

Editor

The Scripted editor is borrowed from Eclipse Orion. So, its look and feel will be familiar to many Eclipse users.

Content assist

Content assist in Scripted uses an inferencer to calculate proposals. The inferencer attempts to propose semantically relevant items, as you can see here:

Content assist

You can see that fun and funToo are proposed with the appropriate return type. Underneath that, you can see the non-inferred proposals. These are any properties found in the file that match the prefix of the current identifier, but cannot be shown to be statically relevant at the location. Since JavaScript is a dynamic language, accuracy in type inferencing will always be weaker than in statically typed languages like Java. For this reason, Scripted also shows the non-inferred proposals in an attempt to propose items that could possibly be relevant.

Navigate to definition

Hovers

Key bindings

Scripted has been designed so that it is keyboard-friendly.

(Note: for simplicity we use the Windows/Linux bindings in this section. For Mac users, replace Ctrl with CMD and the binding will work.)

The following is a list of the most interesting keybindings:

  • Ctrl+Shift+F : open find files dialog
  • Ctrl+F : find-in-file
  • Ctrl+L : go to line
  • Alt+Shif+F : Reformat selection or entire file using JSBeautify
  • Alt+Up : Move selected lines up
  • Alt+Down : Move selected lines down
  • Alt+Shift+Up : Copy selected lines up
  • Alt+Shift+Down : Copy selected lines down
  • Ctrl+Shift+O : Show outline
  • Ctrl+Space : Invoke content assist (this keybinding is the same on Mac as on Windows/Linux. Do not used CMD)
  • Ctrl+Shift+E : Toggle sub-editor
  • Ctrl+Shift+S : Switch between sub and main editors
  • Ctrl+D : Delete selected lines
  • Ctrl+/ : (un-)comment selected lines

And there are others. In the Scripted editor, click on the ? icon to see a complete list.

Where appropriate, we have used the default Eclipse bindings. However, due to clashes with default browser key-bindings, certain keybindings are not available to Scripted. For example, Ctrl+Shift+R is open resource in Eclipse, but in browsers, it is a hard refresh. So, in Scripted, we use Ctrl+Shift+F instead.

Configuration

Here is a complete listing of configuration options available in the .scripted file:

  • ui
    • font : String
    • fontsize : num
    • navigator : bool (hide/show the navigator)
  • jslint See the jslint docs for a full list of options
    • global : list of global variables
    • options : list of jslint options
  • formatter
    • js
      • indent_size (default 4) : indentation size,
      • indent_char (default space) : character to indent with,
      • preserve_newlines (default true) : whether existing line breaks should be preserved,
      • preserve_max_newlines (default unlimited) : maximum number of line breaks to be preserved in one chunk
      • jslint_happy (default false) : if true, then jslint-stricter mode is enforced. jslint_happy will give 'function ()' !jslint_happy will give 'function()'
      • brace_style (default "collapse") :
        • collapse put braces on the same line as control statements (default),
        • expand put braces on own line (Allman / ANSI style)
        • end-expand put end braces on own line.
        • expand-strict put brace on own line even in such cases:
        var a =
        {
            a: 5,
            b: 6
        }
         This mode may break your scripts, so beware\! - e.g when returning an object literal.
  • exec : this section configures shell commands to be executed when certain keybindings or events occur. For a detailed description visit the Executing Shell Commands page.
Clone this wiki locally