blob: 5efd4fc3d362d41c87e3eff8db7c2b3b94d0eefe [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<?asciidoc-toc maxdepth="5"?>
<?asciidoc-numbered maxdepth="5"?>
<book xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
<info>
<title>N4JS IDE Specification</title>
<date>2019-08-07</date>
<author>
<personname>
<firstname>2019-08-07 15:02:40 CEST</firstname>
</personname>
</author>
<authorinitials>{</authorinitials>
<style>
.admonitionblock td.icon .icon-todo:before{content:"\f249";color:#f4ee42}
</style>
</info>
<preface>
<title></title>
<simpara role="center"><emphasis role="strong">Last Updated: 2019-08-07</emphasis></simpara>
<simpara role="center"><emphasis role="strong">Authors:</emphasis><?asciidoc-br?>
Jens von Pilgrim, Jakub Siberski, Mark-Oliver Reiser, Torsten Krämer, Ákos Kitta, Sebastian Zarnekow, Lorenzo Bettini, Jörg Reichert, Kristian Duske, Marcus Mews, Minh Quang Tran, Luca Beurer-Kellner</simpara>
<simpara><?asciidoc-pagebreak?></simpara>
<bridgehead xml:id="_abstract" renderas="sect1">Abstract</bridgehead>
<simpara>This document contains the N4JS IDE Specification.</simpara>
<bridgehead xml:id="_introduction" renderas="sect1">Introduction</bridgehead>
<simpara>This document describes the features of the N4JS <link linkend="AC">IDE</link>, that is the user interface and features available to users of the <link linkend="AC">IDE</link>. The language N4JS is described in [<link linkend="N4JSSpec">N4JSSpec</link>] and is not part of this document.</simpara>
</preface>
<chapter xml:id="sec:Views">
<title>Views</title>
<simpara>This section briefly introduces all the views that belong to the application’s default perspective.</simpara>
<section xml:id="_eclipse-standard-views">
<title>Eclipse Standard Views</title>
<simpara>In the following we descibe views usually available in Eclipse based IDEs. Some of the views were slightly adjusted to match specific N4JS needs.</simpara>
<section xml:id="sec:Project_Explorer_View">
<title>Project Explorer</title>
<simpara>The Project Explorer view shows the resources from the underlying workspace in a hierarchical way. From this view one can open a resource for editing in the associated editor or select it to perform an operation on the resource. A popup contest menu is available from the Project Explorer for each resources if used right clicks any of them. A lot of convenient actions are available for from the popping context menu: file modifications (such as Copy, Cut, Paste and Delete) and import/export. Project Explorer support file system modifications by drag-and-dropping resources. One can link the Project Explorer with the editors, if one enables the view-editor-linking then the node in the tree representing a particular resource in the workspace will be automatically revealed and highlighted once one activates the corresponding editor. This works the other way around as well, when a node is selected in the tree and the corresponding resource is opened in an editor, then the editor will be activated.</simpara>
</section>
<section xml:id="sec:Outline_View">
<title>Outline</title>
<simpara>The Outline view is responsible for displaying the outline of a structured file that is currently opened in an editor. In case of opening an N4JS file the view depicts all the types defined in the file. The owned members, functions and methods of a particular type are represented in a tree structure. Furthermore in case of opening an N4JS file in the editor, one can link the Outline view with the editor which means whenever one selects a node from the outline view the corresponding item will be revealed and highlighted in the editor.</simpara>
</section>
<section xml:id="sec:Problems_View">
<title>Problems</title>
<simpara>This view is used to show all validation errors and warnings in a table that are generated for workbench resources such as N4JS files. For instance when one writes and/or saves an N4JS file that contains validation errors and/or warnings those issues will be automatically logged into the Problems view. One can reveal the actual problem in the N4JS by simply double-clicking on the problem in the view. In this case the corresponding N4JS file will be opened (if it was not already opened), activated and the relevant line will be revealed in the editor. By default the grouping in the Problems view is done by the severity of the issues. One can group the issues by issue type or just disable the grouping at all. The first column of the table is the actual description of the issue for a particular resource. The second column names the problematic resource itself. The third column shows the relative path of the problematic resource. The location, fifth, column describes the problematic line in the resource. And last but not least the sixth column is for naming the type of the problem. This is optional and might be missing for some cases. One can customise the content of the view from the view menu. One can limit the number of revealed items in the table or can modify the behaviour of the content provider.</simpara>
</section>
<section xml:id="sec:Console_View">
<title>Console</title>
<simpara>The Console view is used to reveal a text based output provided by a running process and also allows user to provide any input to the running process from the keyboard.</simpara>
</section>
<section xml:id="sec:History_View">
<title>History</title>
<simpara>History view supports a way to track the changes of the workbench resources. This view also responsible for providing a convenient way to reveal historical revisions of a particular resource and it is even supports a mechanism to compare two different revisions of a resource. By default this view only provides local historical information but if a resource is under version control then one can retrieve revisions for that particular resource even it was made by remotely by another IDE user.</simpara>
</section>
<section xml:id="sec:Error_Log_View">
<title>Error Log</title>
<simpara>The Error Log view captures and logs all errors and warnings in a table generated by the application itself. Unlike Problems view the Error Log is responsible to collect and to reveal issues caused by a malfunctioned component or module of the IDE.</simpara>
</section>
</section>
<section xml:id="_n4js-specific-views">
<title>N4JS Specific Views</title>
<simpara>The following views are specific to N4JS. Some of these views are useful for developers of the N4JS language itself as they reveal internal details at runtime. Most of these views can be opened via <literal>Windows/Show View/Other..</literal>, see <literal>N4JS</literal> category.</simpara>
<section xml:id="_test-results">
<title>Test Results</title>
<simpara>The N4JS equivalent to the JUnit test view.</simpara>
</section>
<section xml:id="_source-graphs">
<title>Source Graphs</title>
<simpara>Shows the AST of the current source code in the editor windows.</simpara>
</section>
<section xml:id="_api-compare">
<title>API Compare</title>
<simpara>Shows compare results, i.e. the difference between an API definition project and its implementation.</simpara>
</section>
<section xml:id="_performance-graphs">
<title>Performance Graphs</title>
<simpara>Shows some performance measurements of typical tasks such as builds.</simpara>
</section>
<section xml:id="_source-mapping">
<title>Source Mapping</title>
<simpara>Shows source maps, i.e. the relation between N4JS source code and the generated plain JavaScript code.</simpara>
</section>
<section xml:id="_xpect-view">
<title>Xpect View</title>
<simpara>Shows result of an Xpext run, may be used to submit bug reports.</simpara>
</section>
</section>
</chapter>
<chapter xml:id="_navigation">
<title>Navigation</title>
<simpara>In this chapter we describe specific views and features to allow for easy navigation.</simpara>
<section xml:id="sec:Outline_Navigation" role="language-n4js">
<title>Outline</title>
<simpara>In general, a outline view and a quick outline are supported. Both outlines work similar, which is why both are specified together. The outline of an N4JS file is a tree which should show the following structure: <anchor xml:id="sec:N4JS_Outline" xreflabel="[sec:N4JS_Outline]"/></simpara>
<itemizedlist>
<listitem>
<simpara>Top-level defined classes, interfaces, roles, enums, functions and exported variables. For all these different types, icons are to be used (similar to JDT). Beside the name, type variables should be shown as well, if defined.</simpara>
</listitem>
<listitem>
<simpara>Members of classifiers are to be shown in the classifier branch. All members (fields, methods, field accessors) are to be shown, with appropriate icons indicating the type (field/member), static flag, access modifier, abstract flag. The icons should look similar to JDT.</simpara>
</listitem>
<listitem>
<simpara>an import declaration should have a node in the outline view, if multiple elements are imported these should represented as child nodes of that import declaration node. If the import uses aliases the original name and the alias name should appear in the outline node text.</simpara>
</listitem>
<listitem>
<simpara>for a non exported function declaration no outline node should be created</simpara>
</listitem>
<listitem>
<simpara>for a non exported variable declaration no outline node should be created</simpara>
</listitem>
<listitem>
<simpara>for a exported variable statement there should be a node in the outline, if this statement contains only one variable declaration the node represents this declaration. For multiple variable declarations in the statement the statement node just is a comma separated list of the variable names and for each variable there is child node</simpara>
</listitem>
<listitem>
<simpara>for fields, functions, methods, getters and variables their declared (return) type should be shown (by adding : typeName after the element name). If the type is inferred then the type name should be presented in a different color</simpara>
</listitem>
<listitem>
<simpara>for functions, methods and setters each formal parameter should be represented by its declared or inferred type (when inferred than with different color)</simpara>
</listitem>
<listitem>
<simpara>constructors are represented by the method icon and a decorator in the top right corner</simpara>
</listitem>
<listitem>
<simpara>enumeration literals are represented with the same decoration as static final fields</simpara>
</listitem>
</itemizedlist>
<simpara>The top-level elements must be sortable either by order in the file (default) or alphabetically.</simpara>
<section xml:id="_quick-outline">
<title>Quick Outline</title>
<simpara>The quick outline supports two modes. The modes are iteratively selected by pressing <keycombo><keycap>CMD/CTRL</keycap><keycap>O</keycap></keycombo>.</simpara>
<variablelist>
<varlistentry>
<term>owned</term>
<listitem>
<simpara>This is the default mode, only members directly owned by the type are shown</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>inherited</term>
<listitem>
<simpara>In this mode, the owned members are shown including inherited, consumed, or polyfilled members. The origin is also shown and a different color is used to highlight the special status of these members. For usability reasons (limiting the number of filters), inherited, consumed and polyfilled members are treated similarly.</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="_normal-outline">
<title>Normal Outline</title>
<simpara>In the normal outline view, toggles are used for the same purpose. Visualisations are similar to the quick outline view.</simpara>
<variablelist>
<varlistentry>
<term>inherited</term>
<listitem>
<simpara>By default, only owned members of a type are shown. If the "inherited" toggle is active, inherited, consumed, or polyfilled members as well. For usability reasons (limiting the number of filters), inherited, consumed, and polyfilled members are treated similarly.</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara></simpara>
<sidebar>
<simpara><link xl:href="https://github.com/eclipse/n4js/issues/99"><inlinemediaobject>
<imageobject>
<imagedata fileref="images/issue.svg"/>
</imageobject>
<textobject><phrase></phrase></textobject>
</inlinemediaobject> #99</link></simpara>
</sidebar>
<variablelist>
<varlistentry>
<term>sorting</term>
<listitem>
<simpara>By default, all elements are sorted in the order of their appearance in the source code. If alphabetic sorting is enabled, they are sorted alphabetically.</simpara>
</listitem>
</varlistentry>
</variablelist>
<todo>
<simpara>Potential improvements:</simpara>
<itemizedlist>
<listitem>
<simpara>show decorator when a member overrides and member from a super class / super interface or role</simpara>
</listitem>
<listitem>
<simpara>show object literals and their members in the outline view (just filter <literal>eAllContents</literal> of an element that already has a node in outline view for object literals)</simpara>
</listitem>
<listitem>
<simpara>show function expression in the outline view (just filter <literal>eAllContents</literal> of an element that already has a node in outline view for function expressions)</simpara>
</listitem>
</itemizedlist>
</todo>
</section>
</section>
<section xml:id="_navigation-commands">
<title>Navigation Commands</title>
<section xml:id="sec:Navigate_to_Declaration">
<title>Navigate to Declaration</title>
<simpara>It is possible to Command-click on almost every reference and jump to its declaration.</simpara>
</section>
<section xml:id="sec:find_by_references">
<title>Find by References</title>
<simpara>For each referenceable element in an open N4JS file you can click your mouse and invoke the context menu to select <literal>Find references</literal>. Then in the Eclipse search view all found references are displayed as tree: each match is structured by resource path and coarse grained element in the resource (like a method). If there are multiple matches within a method only the first match is linked but in its display string the total match count is shown in brackets.</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>find by references shows the result as tree in the Eclipse search view with having elements that are members or have defined type displayed as nodes</simpara>
</listitem>
<listitem>
<simpara>every found reference is displayed under its nearest parent that is a member or has a defined type</simpara>
</listitem>
<listitem>
<simpara>if there a multiple found references in a node only the first one is displayed (and linked) + the number of all total matches is shown as part of the display string (like in JDT)</simpara>
</listitem>
</orderedlist>
</section>
<section xml:id="sec:Open_Type_Declaration">
<title>Open Type Declaration</title>
<simpara>One can quickly browse the workbench for available types. The declaration of the types can be opened in editor from this dialog. The N4JS type search dialog can be raised with the <keycap>Cmd</keycap> + <keycap>Shift</keycap> + <keycap>T</keycap> key binding (<keycap>Ctrl</keycap> + <keycap>Shift</keycap> + <keycap>T</keycap> on Windows and Linux systems).</simpara>
<itemizedlist>
<listitem>
<simpara>Enter <emphasis role="strong">exact type name</emphasis>, prefix name or a camel case pattern to run a query against the types. The following rules and patterns are supported.</simpara>
<itemizedlist>
<listitem>
<simpara><emphasis role="strong">Wildcards</emphasis>: <literal>?</literal> for any character and <literal>*</literal> for any string.</simpara>
</listitem>
<listitem>
<simpara><emphasis role="strong">Camel case</emphasis>: <literal>DM</literal> will return with all types that contains <literal>D</literal> and <literal>M</literal> with the given order such as <literal>DataMap</literal> and <literal>DataMapEntry</literal> but not <literal>ImmutableDataMap</literal>.</simpara>
<simpara><literal>AcBuGr</literal> will return with all types that contain <literal>Ac</literal>, <literal>Bu</literal> and <literal>Gr</literal> with the given order such as <literal>ActionButtonGroup</literal>.</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara><emphasis role="strong">Highlighting</emphasis>: The matching types names are highlighted according to the matching parts.</simpara>
</listitem>
<listitem>
<simpara><emphasis role="strong">Decorator</emphasis> for duplicate type names: The internally used fully qualified name of the type will be appended to the type name automatically, so one can easily distinguish between types even there are type name collision.</simpara>
</listitem>
<listitem>
<simpara><emphasis role="strong">Opening types in editor</emphasis>: Type declarations can be opened in the editor in the following ways: after entering the type name prefix or pattern to the filter text one can navigate among the filtered items with the up and/or down arrow keys. Simply hitting return on the keyboard or clicking on the ’OK’ button the currently selected declaration of the selected type will be opened in the editor. For opening multiple type declarations one can use the <keycap>Shift</keycap> modifier to select more than one element. Single type can be opened with double clicking on it in the dialog.</simpara>
</listitem>
<listitem>
<simpara><emphasis role="strong">History</emphasis>: Once a type is being opened then it will be available among the recently opened type in the type search dialog. These items will show up in the upper part of the list in the dialog.</simpara>
</listitem>
</itemizedlist>
</section>
</section>
<section xml:id="sec:Working_Sets" role="language-bash">
<title>Working Sets</title>
<simpara>Working sets are used to logically group resources, projects in the Project Explorer (navigator) and in the UI in general. Although a couple of projects can be easily handled and shown without any sophisticated working set support in the navigator, larger code sources consisting of multiple projects could cause some trouble when one has to maintain them. Indeed one could use multiple workspaces and could switch between them or can simply manually open-close relevant projects, but this gets cumbersome too.</simpara>
<simpara>This section describes the general design of the N4JS specific working set support and also introduces a couple of use cases while enumerating the constraints.</simpara>
<section xml:id="sec:Working_Set_Managers">
<title>Working Set Managers</title>
<simpara>Just like the JDT (<literal>org.eclipse.jdt.internal.ui.workingsets.WorkingSetModel</literal>) based working set support, the N4JS IDE based approach is also aware of the <literal>org.eclipse.ui.IWorkingSet</literal> and the <literal>org.eclipse.ui.IWorkingSetManager</literal> APIs but besides simply using them it comes with its own implementation and adapts it to the default Eclipse based one, furthermore it also comes with an Eclipse extension point based mechanism to support various working set managers at the same time to provide even better user experience and a more convenient way of working set management.</simpara>
<simpara>A working set manager can be contributed to the IDE via the <literal>org.eclipse.n4js.ui.workingSetManager</literal> extension point, then the implementation class must implement the <literal>org.eclipse.n4js.ui.workingsets.WorkingSetManager</literal> interface but it is highly recommended to rather extend the <literal>org.eclipse.n4js.ui.workingsets.WorkingSetManagerImpl</literal> class. Guice based dependency injection should also be considered when implementing the custom working set manager. It means that each custom working set manager implementation must have a public <emphasis>no-args</emphasis> constructor. This <emphasis>no-args</emphasis> constructor will be invoked when creating the instances via <literal>IConfigurationElement#createExecutableExtension(String)</literal> method. Then the members, if any will be injected by the working set manager broker. Below <literal>plugin.xml</literal> snippet describes how to contribute a custom working set manager to the IDE.</simpara>
<programlisting language="xml" linenumbering="unnumbered"> &lt;extension
point="org.eclipse.n4js.ui.workingSetManager"&gt;
&lt;manager
class="some.package.name.MyExecutableExtensionFactory:some.package.name.MyWorkingSetManager"&gt;
&lt;/manager&gt;
&lt;/extension&gt;</programlisting>
<simpara>By default the N4JS IDE comes with five different built-in working set managers. These are the followings:</simpara>
<itemizedlist>
<listitem>
<simpara>Manual Association Working Set Manager,</simpara>
</listitem>
<listitem>
<simpara>Project Name Filter Working Set Manager,</simpara>
</listitem>
<listitem>
<simpara>Git Repository Working Set Manager,</simpara>
</listitem>
<listitem>
<simpara>Project Location Working Set Manager and</simpara>
</listitem>
<listitem>
<simpara>N4JS Project Type Working Set Manager.</simpara>
</listitem>
</itemizedlist>
<simpara>The benefits and the details of each built-in working set managers will be discussed in later sections but first we have to distinguish between three conceptually different working set manager approaches.</simpara>
<simpara>First off, IDE supports fully static working set managers. Fully static working set managers might manage any arbitrary number of working sets, and each working set might be associated with any number of Eclipse projects. That means, user might create, edit and remove working sets and manually associate projects with individual working sets. One project might belong to multiple working sets. There is a dedicated working set, <emphasis>Other Projects</emphasis>, that cannot be renamed and/or deleted. When no user defined working sets are available this dedicated working set will be still available. IDE comes with one single fully static working set manager: <emphasis>Manual Association Working Set Manager</emphasis>.</simpara>
<simpara>The second kind of working set manager is the semi-dynamic one. That means, user can create, modify and delete working sets, but the associations between the projects and the working sets are automatic. This means, the user might define a working set - project association rule, and the projects will be automatically associated with the working sets. Just like in the above kind, one project might belong to multiple working sets and here as well, there is a dedicated working set manager, that cannot be modified: <emphasis>Other Projects</emphasis>. IDE comes with one semi-dynamic working set manager. That is the <emphasis>Project Name Filter Working Set Manager</emphasis>. User might define a project name filter rule with a regular expression, and each project which name matches a pattern will be associated with the working set. If a project does not comply to any working set manager rule, then it will belong to the <emphasis>Other Projects</emphasis> working set.</simpara>
<simpara>The third kind of working set manager is the fully-dynamic working set manager. Both the working sets and the project associations are done by some implementation specific rules. Such as Git repository provider based, or project location based approaches. These working set managers have the dedicated <emphasis>Other Projects</emphasis> working set that is used as a fallback working set. For instance, if the <emphasis>Git Repository Working Set Manager</emphasis> is the active one, all projects that are shared with Git will belong to the corresponding working set manager but if a project is not yet a shared project, then it will belong to the dedicated fallback working set. As always that working set manager cannot be deleted and/or modified.</simpara>
</section>
<section xml:id="sec:Working_Set_Constraints">
<title>Working Set Constraints</title>
<simpara>This section enumerates a set of constraints that have to considered by both end users and implementors:</simpara>
<itemizedlist>
<listitem>
<simpara>Working set manager identifier must be unique.</simpara>
</listitem>
<listitem>
<simpara>The identifier of the working set manager must be unique per container working set managers.</simpara>
</listitem>
<listitem>
<simpara>Each working set must have a working set with <emphasis>Other Projects</emphasis> unique ID and name.</simpara>
</listitem>
<listitem>
<simpara>Working sets with <emphasis>Other Projects</emphasis> unique ID must not be editable nor deletable.</simpara>
</listitem>
<listitem>
<simpara>At least one working set should be visible (not hidden) per working set managers.</simpara>
</listitem>
<listitem>
<simpara>Working set managers are activated when the <emphasis>Working Sets</emphasis> are configured as <emphasis>Top Level Elements</emphasis> in the <emphasis>Project Explorer</emphasis>.</simpara>
</listitem>
<listitem>
<simpara>Working set order can be specified and customized by the user if it is not specified yet, then a case sensitive ordering based on the working set names should be applied.</simpara>
</listitem>
</itemizedlist>
</section>
<section xml:id="sec:Manual_Association_Working_Set_Manager_UI_Features">
<title>Manual Association Working Set Manager - UI Features</title>
<simpara>This section describes the working set manager by introducing the UI capabilities as well.</simpara>
<simpara>This working set manager is a fully static working set manager and activated and used as the default one when the working set manager support is turned on in the IDE. With this working set manager one can create a new working set by simply defining a unique name for the working set and associating any number of workspace project to the working set. Furthermore existing working sets can be modified and deleted but the <emphasis>Other Projects</emphasis> working set. The working set support can be turned on in the <emphasis>Project Explorer</emphasis> view. Via the view menu one has to select <emphasis>Top Level Elements</emphasis> <emphasis>&gt;</emphasis> <emphasis>Working Sets</emphasis> menu item.</simpara>
<figure role="center">
<title>Activate Working Set Managers</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/04_navigation/fig/activate_working_set_managers.png" width="50%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>Activate_Working_Set_Managers</phrase></textobject>
</mediaobject>
</figure>
<simpara>After the working set manager mode activation, a new toolbar contribution item become visible and user can select among the available working set managers.</simpara>
<figure role="center">
<title>Select Working Set Manager</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/04_navigation/fig/select_working_set_manager_01.png" width="50%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>Select_Working_Set_Manager</phrase></textobject>
</mediaobject>
</figure>
<simpara>As the below picture depicts the available working set managers are listed and the currently active manager is marked with a check. In our case that is the <emphasis>Manual Association Working Set Manager</emphasis>.</simpara>
<figure role="center">
<title>Activate Working Set Manager</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/04_navigation/fig/select_working_set_manager_02.png" width="25%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>Activate_Working_Set_Manager</phrase></textobject>
</mediaobject>
</figure>
<simpara>Once the the <emphasis>Configure Manual Association&#8230;&#8203;</emphasis> menu item is selected, the working set manager configuration dialog pops up. By clicking on the <emphasis>New&#8230;&#8203;</emphasis> button in the configuration dialog, a new working set wizard will be invoked and the manual working set - project association can be configured.</simpara>
<figure role="center">
<title>Configure Working Sets</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/04_navigation/fig/configure_working_sets_01.png" width="25%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>Configure_Working_Sets</phrase></textobject>
</mediaobject>
</figure>
<simpara>In the wizard after specifying the desired unique name of the working set an arbitrary number of workspace projects can be associated with the working set. It is important to note, that a project can be associated with more than one working sets. If a project is not associated with any working sets then it will be automatically linked to the fallback <emphasis>Other Projects</emphasis> working set.</simpara>
<figure role="center">
<title>Working Set - Projects Association</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/04_navigation/fig/working_set_project_association.png" width="50%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>Configure_Working_Set_Project_Association</phrase></textobject>
</mediaobject>
</figure>
<simpara>Once all the changes made are confirmed and the configuration dialog is closed via the <emphasis>OK</emphasis> button, the <emphasis>Project Explorer</emphasis> will be refreshed and will reflect the working set changes.</simpara>
<figure role="center">
<title>Custom Working Sets In Project Explorer</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/04_navigation/fig/working_sets_in_navigator.png" width="25%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>Custom_Working_Sets_In_Project_Explorer</phrase></textobject>
</mediaobject>
</figure>
<simpara>The order of the working sets can be configured and customized in the working set manager configuration dialog, or just simply reordering it from the navigator itself by drag and dropping the available working set managers.</simpara>
<figure role="center">
<title>Re-ordering Working Sets In Project Explorer</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/04_navigation/fig/working_set_reorder.png" width="25%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>Re_Ordering_Working_Sets_In_Project_Explorer</phrase></textobject>
</mediaobject>
</figure>
<simpara>Besides changing the order of the working sets, working sets can be hidden from the navigator. Just like the ordering, this can be changed from the working set configuration dialog, or by simply selecting working sets in the navigator and hiding them via <emphasis>Hide Selected Working Set</emphasis> menu item. Important to note, at least one working set should be visible in the navigator, so if all the working sets are selected in the navigator, then the menu item will be disabled. Same behavior in the working set customization dialog, if all items are unchecked, then the <emphasis>OK</emphasis> button is disabled in the dialog.</simpara>
<figure role="center">
<title>Hide Working Sets In Project Explorer</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/04_navigation/fig/working_set_hide.png" width="25%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>Hide_Working_Sets_In_Project_Explorer</phrase></textobject>
</mediaobject>
</figure>
<simpara>Once at least one working set is hidden from the UI, then a new toolbar contribution become visible in the <emphasis>Project Explorer</emphasis>. This UI contribution provides a quick, convenient way to show a specific or all hidden working sets in the navigator. It is worth to note, if a project is automatically associated with the <emphasis>Other Projects</emphasis> working set (because it does not belong to any working sets due to the lack of manual association) it will be not shown in the navigator if the <emphasis>Other Projects</emphasis> working set is hidden. Once all working sets are visible, indeed the <emphasis>Show Hidden Working Sets</emphasis> toolbar contribution become invisible.</simpara>
<figure role="center">
<title>Show Hidden Working Sets In Project Explorer</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/04_navigation/fig/working_set_show.png" width="25%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>Show_Hidden_Working_Sets_In_Project_Explorer</phrase></textobject>
</mediaobject>
</figure>
<simpara>Besides the above described generic working set UI support, projects can be associated with working sets by simply drag and dropping them from one working set into another. Note, this is only supported for the <emphasis>Manual Association Working Set Manager</emphasis>.</simpara>
</section>
<section xml:id="sec:Project_Name_Filter_Working_Set_Manager">
<title>Project Name Filter Working Set Manager</title>
<simpara>As mentioned earlier, this working set is a semi-dynamic working set. The working sets can be created, edited and deleted by the user by simply specifying project name filter pattern as valid regular expressions but the project association itself is fully automatic. If the name of a project does not match with any project name filter rule, then the project will be associated with the <emphasis>Other Projects</emphasis> working set. Although reordering the working sets from the navigator by simple drag and dropping them is supported, project association is disabled.</simpara>
</section>
<section xml:id="sec:Git_Repository_Working_Set_Manager">
<title>Git Repository Working Set Manager</title>
<simpara>This working set is a fully-dynamic working set. Projects will be associated by the Git providers. It means, if a project is imported from a pre-configured local Git repository, then the project will be associated with the working set linked with the Git repository. The subset of the available working sets is become automatically updated once the Git repository preferences changed by the user. These preferences can be changed on the <emphasis>Git</emphasis> perspective in the <emphasis>Git Repositories</emphasis> view by simple adding or hiding/removing a repository from the view.</simpara>
</section>
<section xml:id="sec:Project_Location_Working_Set_Manager">
<title>Project Location Working Set Manager</title>
<simpara>This fully-dynamic working set manager calculates the subset of available working sets based on the parent folder of the projects. The benefit of this working set manager is to support the convention recommended by the maven/Git folder structuring. The following constraints are applied when associating the projects with the available working sets:</simpara>
<itemizedlist>
<listitem>
<simpara>If a project is located in the root of the Eclipse workspace, then it will be associated with <emphasis>Other Projects</emphasis> working set.</simpara>
</listitem>
<listitem>
<simpara>If a project is nested somewhere in the Eclipse workspace, then it will be associated with a working set that has the same name as the parent folder of the project. Let assume the Eclipse workspace root points to <literal>/eclipse/root</literal> and there is a project <literal>P1</literal> nested in the workspace root at <literal>/eclipse/root/path/to/nested/location/P1</literal>, then the associated working set will be <literal>location</literal>.</simpara>
</listitem>
<listitem>
<simpara>If a project is not contained in the workspace, but has a Git provider that is configured in IDE, and the project root is the local Git repository root, then the associated working set name will be the name of the Git repository. For example, if we have Eclipse workspace root pointing to <literal>/eclipse/root</literal> location and a <literal>P2</literal> project located <literal>/some/path/to/git/P2</literal> but this location is the location of a registered Git repository, then the name of the associated working set will be neither <literal>Other Projects</literal> not <literal>git</literal> but <literal>P2</literal> since that is known Git local repository root.</simpara>
</listitem>
<listitem>
<simpara>If project <literal>P3</literal> is not contained in the Eclipse workspace but contained in a known local Git repository just like above, but the project root is not the local Git repository root, then the name of the parent folder will be considered as the name of the associated working set. This rule is a hybrid alternative of the second and the third constraints, hence for instance if the project is under <literal>/some/path/to/git/repositoryName/plugins/P3</literal> and <literal>repositoryName</literal> is local git repository, then the name of the associated working set will be <literal>plugins</literal> and not <literal>repositoryName</literal>.</simpara>
</listitem>
<listitem>
<simpara>Else the associated working set will be the <emphasis>Other Projects</emphasis> fallback working set.</simpara>
</listitem>
</itemizedlist>
</section>
<section xml:id="sec:N4JS_Project_Type_Working_Set_Manager">
<title>N4JS Project Type Working Set Manager</title>
<simpara>This is working set manager is a N4JS specific fully-dynamic working set manager. The working sets will be calculated based on the instances defined by the <literal>org.eclipse.n4js.n4mf.ProjectType</literal> type. Each accessible N4JS project will be associated to a working set based on the project type. A workspace project will be associated with the <emphasis>Other Projects</emphasis> fallback working set if any of the followings are true to the project:</simpara>
<itemizedlist>
<listitem>
<simpara>The project is not accessible. (It does not exist or is not opened.)</simpara>
</listitem>
<listitem>
<simpara>The project does not configured with <emphasis>Xtext</emphasis> nature.</simpara>
</listitem>
<listitem>
<simpara>The project does not have an <emphasis>Xtext</emphasis> builder command ID.</simpara>
</listitem>
<listitem>
<simpara>The project does not have a valid N4 manifest file.</simpara>
</listitem>
</itemizedlist>
</section>
</section>
</chapter>
<chapter xml:id="_assistance">
<title>Assistance</title>
<simpara>In this chapter we describe all kind of tools assisting the user when writing code, i.e. content assist, quickfixes, quick assists, etc.</simpara>
<warning>
<simpara>Not all features are yet implemented!</simpara>
</warning>
<section xml:id="sec:Content_Assist" role="language-n4js">
<title>Content Assist</title>
<simpara>Content assist may change the document at various places at once. In those cases, it is important to prevent flickering in the editor. The FQNImporter provides a blue print how to adjust line numbers properly and scroll the viewport of the current editor to minimize flickering in the UI.</simpara>
<simpara>Completions not listed here as they are provided by template proposals:</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Classifier declaration template proposal</simpara>
</listitem>
<listitem>
<simpara>Function declaration template proposal</simpara>
</listitem>
<listitem>
<simpara>Getter/Setter pair template proposal</simpara>
</listitem>
</orderedlist>
<section xml:id="sec:Complete_Keywords">
<title>Complete Keywords</title>
<simpara>Complete keyword which are syntactically correct at a given location. Do not suggest completions which would lead to wrong code.</simpara>
<simpara>Keywords that contain only a single character are not proposed since they would pollute the proposal window and don’t offer added value.</simpara>
<simpara>Special attention has to be given to operators. Since they are modelled in the grammar and not as cross references, their validaty is purely syntactically. That is, there is no generic facility in Xtext, that allows to filter unapplicable operators as there is for cross references.</simpara>
</section>
<section xml:id="sec:Complete_Annotations">
<title>Complete Annotations</title>
<simpara>Annotations can be proposed depending on the following elements or the context.</simpara>
</section>
<section xml:id="sec:Complete_Identifier_Reference">
<title>Complete Identifier Reference</title>
<simpara>References to identifiers can be automatically completed. This is even true if the declaration is not imported yet, as the import may be automatically added as well.</simpara>
<simpara>The IDE supports auto-completion of an identifier referencing to a declaration.</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Complete type references.</simpara>
</listitem>
<listitem>
<simpara>Complete function references.</simpara>
</listitem>
<listitem>
<simpara>Complete variable references.</simpara>
</listitem>
<listitem>
<simpara>Complete parameter references.</simpara>
</listitem>
<listitem>
<simpara>If necessary, imports are added automatically to complete reference <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi></math> to declaration <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>D</mi></math>.</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara>-</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mspace width="3.0mm"/><mi>b</mi><mi>i</mi><mi>n</mi><mi>d</mi><mfenced close=")" open="("><mi>r</mi><mi>D</mi></mfenced></math><?asciidoc-br?>
<math xmlns="http://www.w3.org/1998/Math/MathML"><mspace width="3.0mm"/><mo></mo></math><?asciidoc-br?>
<math xmlns="http://www.w3.org/1998/Math/MathML"><mspace width="3.0mm"/><mi>r</mi><mo>.</mo><mi>n</mi><mi>a</mi><mi>m</mi><mi>e</mi><mo>=</mo><mi>D</mi><mo>.</mo><mi>n</mi><mi>a</mi><mi>m</mi><mi>e</mi></math><?asciidoc-br?>
<math xmlns="http://www.w3.org/1998/Math/MathML"><mspace width="3.0mm"/><mi>D</mi><mo></mo><mi>r</mi><mo>.</mo><mi>m</mi><mi>o</mi><mi>d</mi><mi>u</mi><mi>l</mi><mi>e</mi></math><?asciidoc-br?>
<math xmlns="http://www.w3.org/1998/Math/MathML"><mspace width="3.0mm"/><mo></mo></math><?asciidoc-br?>
<math xmlns="http://www.w3.org/1998/Math/MathML"><mspace width="3.0mm"/><mo></mo><mstyle mathvariant="monospace"><mtext>NamedImportSpecifier</mtext></mstyle><mi>N</mi><mi>I</mi><mi>S</mi><mi>:</mi></math><?asciidoc-br?>
<math xmlns="http://www.w3.org/1998/Math/MathML"><mspace width="3.0mm"/><mi>W</mi><mi>I</mi><mi>S</mi><mo>.</mo><mi>i</mi><mi>m</mi><mi>p</mi><mi>o</mi><mi>r</mi><mi>t</mi><mi>D</mi><mi>e</mi><mi>c</mi><mi>l</mi><mo>.</mo><mi>i</mi><mi>m</mi><mi>p</mi><mi>o</mi><mi>r</mi><mi>t</mi><mi>e</mi><mi>d</mi><mi>M</mi><mi>o</mi><mi>d</mi><mi>u</mi><mi>l</mi><mi>e</mi><mo>=</mo><mi>D</mi><mo>.</mo><mi>m</mi><mi>o</mi><mi>d</mi><mi>u</mi><mi>l</mi><mi>e</mi></math><?asciidoc-br?>
<math xmlns="http://www.w3.org/1998/Math/MathML"><mspace width="3.0mm"/><mo></mo><mo></mo><mstyle mathvariant="monospace"><mtext>WildcardImportSpecifier</mtext></mstyle><mi>W</mi><mi>I</mi><mi>S</mi><mi>:</mi></math></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Description</term>
<listitem>
<simpara>There might be multiple declarations <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>D</mi></math> in project (or in dependent projects) with <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>D</mi><mo>.</mo><mi>n</mi><mi>a</mi><mi>m</mi><mi>e</mi><mo>=</mo><mi>r</mi><mo>.</mo><mi>n</mi><mi>a</mi><mi>m</mi><mi>e</mi></math>. If the declaration <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>D</mi></math> is not local, then a named import may be created by the content assist:</simpara>
<orderedlist numeration="loweralpha">
<listitem>
<simpara>If the declaration <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>D</mi></math> is local, no import is created</simpara>
</listitem>
<listitem>
<simpara>If an import enabling access to the declaration already exists, no other import is created.</simpara>
</listitem>
<listitem>
<simpara>If an alias already exists, the alias name is used, even if the prefix was different when the content assist was activated.</simpara>
</listitem>
<listitem>
<simpara>If the import would conflict with an existing member, an alias is proposed along with the import. Linked editing helps to choose a proper alias.</simpara>
</listitem>
<listitem>
<simpara>All imports from a single module are done within a single import declaration. The exception to this rule are wildcard imports that provide a simple name which is currently unused. In that case, a new import may be necessary to disambiguate the wildcard.</simpara>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
</listitem>
<listitem>
<simpara>If the identifier reference refers to a function (or method), an opening and a closing parenthesis are appended and
the cursor is positioned between these two parentheses.</simpara>
</listitem>
</orderedlist>
</section>
<section xml:id="sec:Complete_Member_Overrides">
<title>Complete Member Overrides</title>
<simpara>A prefix of an inherited member can be used to autocomplete that to a complete declaration.
This is in particular true for methods.</simpara>
</section>
<section xml:id="sec:Constructor_Completion">
<title>Constructor Completion</title>
<simpara>Constructor Completion Based on the declared fields and super constructor, constructor methods can be completed.</simpara>
</section>
<section xml:id="sec:Complete_Function_Expression">
<title>Complete Function Expression with Known Type</title>
<simpara>If a function expression is used as an argument or assigned to a typed variable, the signature of the function can be derived from the type. This can be used to complete a function expression.</simpara>
</section>
<section xml:id="sec:Complete_Variable_and_Parameter_Names">
<title>Complete Variable and Parameter Names</title>
<simpara>Variable and parameter names can be completed based on the type. Camel case detection is used to propose different variations.</simpara>
<simpara>Completion of variables references see <link linkend="sec:Complete_Identifier_Reference">Complete Identifier Reference</link>.</simpara>
</section>
</section>
<section xml:id="sec:Quick_Fixes" role="language-n4js">
<title>Quick Fixes</title>
<simpara>Quick fixes try to solve issues, i.e. errors or warnings, automatically. This is done by rewriting code, either at the location of the issue or at referenced locations.</simpara>
<simpara>In all cases, a quick fix must only be suggested if the following preconditions are fulfilled:</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>All locations at which modifications have to be done must be writeable.</simpara>
</listitem>
<listitem>
<simpara>If bindings are involved, e.g., names are to be changed, all previous bindings must remain similar. This might be more complicated as it seems!</simpara>
</listitem>
</orderedlist>
<section xml:id="sec:N4JS_Issue_Properties">
<title>N4JS Issue User data</title>
<simpara>As some quick fixes need more information to decide upfront which strategy to use, some issues provide additional data. These properties are defined in the file <literal>IssueUserDataKeys.java</literal> in the <literal>org.eclipse.n4js.validation</literal> package. They can for example be accessed by passing the according key to the <literal>getUserData</literal> method of an <literal>N4JSIssue</literal> instance. They are also available as array based Xtext Issue user data.<?asciidoc-br?></simpara>
<simpara>All available user data keys are described for each Issue code in <link linkend="sec:N4JS_Issue_Fixes">N4JS Issue Fixes</link>.</simpara>
</section>
<section xml:id="sec:N4JS_Issue_Fixes">
<title>N4JS Issue Fixes</title>
<simpara>The principle idea is to provide a quick fix for every issue, if it is possible to automatically solve it.</simpara>
<section xml:id="sec:Linking_Issues">
<title>Linking Issues</title>
<simpara>Linking issues are special in that they are created by the standard Xtext linker and use all the same built-in issue code <literal>Diagnostic.LINKING_DIAGNOSTIC</literal>. Therefore, we cannot refer to these issues using one of our custom N4JS issue codes.</simpara>
<variablelist>
<varlistentry>
<term>Diagnostic.LINKING_DIAGNOSTIC</term>
<listitem>
<simpara><literal>Couldn’t resolve reference to <emphasis>n</emphasis></literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Add missing import declaration for unresolved name <emphasis>n</emphasis>.</simpara>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>Precondition</simpara>
</entry>
<entry>
<orderedlist numeration="loweralpha">
<listitem>
<simpara>An exported identifiable element <emphasis>e</emphasis> with name <emphasis>n</emphasis> exists in another module <emphasis>m</emphasis>.</simpara>
</listitem>
<listitem>
<simpara><emphasis>e</emphasis> is visible from the given location.</simpara>
</listitem>
</orderedlist>
</entry>
</row>
<row>
<entry>
<simpara>Label</simpara>
</entry>
<entry>
<simpara><literal>Import <emphasis>n</emphasis> - <emphasis>m</emphasis></literal></simpara>
<variablelist>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara>An import declaration was added such that name <emphasis>n</emphasis> is now resolvable at the given location and bound to <emphasis>e</emphasis>.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Description</term>
<listitem>
<simpara>Some important notes:</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara><literal>A</literal> separate quick fix is proposed for each candidate element instead of having a single generic quick fix for adding imports and showing a dialog later (for example, create two quick fixes “Import class <literal>X</literal> from module M1" and “Import interface <literal>X</literal> from module M2" instead of a single quick fix “Add import for name X").<?asciidoc-br?>
This is unusual for quick fixes, because it means significant work has to be done upfront when creating the quick fix / modification proposals, which raises performance concerns. However,</simpara>
<orderedlist numeration="loweralpha">
<listitem>
<simpara>the JDT handles this the same way and</simpara>
</listitem>
<listitem>
<simpara>this brings the implementation closer to content assist allowing more reuse, therefore this decision was taken.</simpara>
</listitem>
</orderedlist>
</listitem>
<listitem>
<simpara>For consistency, matching of lower/upper/camel case is to be handled as in code completion during content assist. The same applies to display string formatting, esp. name formatting and coloring of element <emphasis>e</emphasis> and module <emphasis>m</emphasis>.</simpara>
</listitem>
<listitem>
<simpara>Note that here we can make more assumptions than during import as part of content assist. For example, we know that the element is not imported yet (otherwise there would not be an error) and there won’t be a need for an alias and linked editing.</simpara>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section xml:id="sec:Import_Issues">
<title>Import Issues</title>
</section>
<section xml:id="sec:Visibility_Issues">
<title>Visibility Issues</title>
<variablelist>
<varlistentry>
<term>VIS_ILLEGAL_MEMBER_ACCESS</term>
<listitem>
<simpara><literal>The <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi><mi>e</mi><mi>m</mi><mi>b</mi><mi>e</mi><mi>r</mi><mi>T</mi><mi>y</mi><mi>p</mi><mi>e</mi></math> <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi><mi>e</mi><mi>m</mi><mi>b</mi><mi>e</mi><mi>r</mi></math> is not visible.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Change access modifier to protected/public or remove <literal>@Internal</literal> annotation.</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara>The file containing the declaration of <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi><mi>e</mi><mi>m</mi><mi>b</mi><mi>e</mi><mi>r</mi></math> is modifiable</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara>The access modifier has been changed so that <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi><mi>e</mi><mi>m</mi><mi>b</mi><mi>e</mi><mi>r</mi></math> is visible at issue location.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>User Data</term>
<listitem>
<itemizedlist>
<listitem>
<simpara><emphasis role="strong">ACCESS_SUGGESTION</emphasis> The most restrictive modifier making the member visible.</simpara>
</listitem>
<listitem>
<simpara><emphasis role="strong">DECLARATION_OBJECT_URI</emphasis> The EObject URI of the member declaration</simpara>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
<simpara>This table shows the access modifier changes to perform to fix the visibility issue while maintaining the strongest access restrictions possible.</simpara>
<informaltable frame="all" rowsep="1" colsep="1">
<tgroup cols="7">
<colspec colname="col_1" colwidth="14.2857*"/>
<colspec colname="col_2" colwidth="14.2857*"/>
<colspec colname="col_3" colwidth="14.2857*"/>
<colspec colname="col_4" colwidth="14.2857*"/>
<colspec colname="col_5" colwidth="14.2857*"/>
<colspec colname="col_6" colwidth="14.2857*"/>
<colspec colname="col_7" colwidth="14.2858*"/>
<tbody>
<row>
<entry align="center" valign="top" morerows="1"><simpara><literal>Access Modifier</literal></simpara></entry>
<entry align="center" valign="top" namest="col_2" nameend="col_7"><simpara><literal>Accessible From</literal></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><literal>Inside Module</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>Inside Project</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>Vendor Subtypes</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>Vendor Projects</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>Other Subtypes</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>Everywhere</literal></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><literal>private</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>project</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>protected@Internal</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>public@Internal</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>protected</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>public</literal></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><literal>project</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>protected@Internal</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>public@Internal</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>protected</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>public</literal></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><literal>protected@Internal</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>public@Internal</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>protected</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>public</literal></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><literal>protected</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>public@Internal</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>public</literal></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><literal>public@Internal</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>public</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>public</literal></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><literal>public</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>-</literal></simpara></entry>
</row>
</tbody>
</tgroup>
</informaltable>
<simpara>Member access modifier changes for quick fixes</simpara>
<variablelist>
<varlistentry>
<term>VIS_ILLEGAL_FUN_ACCESS</term>
<listitem>
<simpara><literal>The function <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>f</mi></math> is not visible.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Change access modifier to protected/public or remove <literal>@Internal</literal> annotation.</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara>The access modifier has been changed so that <emphasis>f</emphasis> is visible at issue location.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>User Data</term>
<listitem>
<itemizedlist>
<listitem>
<simpara><emphasis role="strong">ACCESS_SUGGESTION</emphasis> The most restrictive modifier making the function visible.</simpara>
</listitem>
<listitem>
<simpara><emphasis role="strong">DECLARATION_OBJECT_URI</emphasis> The EObject URI of the function declaration</simpara>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>VIS_ILLEGAL_TYPE_ACCESS</term>
<listitem>
<simpara><literal>The type <emphasis>T</emphasis> is not visible.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Change access modifier to protected/public or remove <literal>@Internal</literal> annotation.</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara>The access modifier has been changed so that <emphasis>T</emphasis> is visible at issue location.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>User Data</term>
<listitem>
<simpara>see VIS_ILLEGAL_FUN_ACCESS</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>VIS_ILLEGAL_VARIABLE_ACCESS</term>
<listitem>
<simpara><literal>The variable <emphasis>v</emphasis> is not visible.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Change access modifier to protected/public or remove <literal>@Internal</literal> annotation.</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara>Module containing <emphasis>v</emphasis> is writeable.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara>The access modifier has been changed so that <emphasis>v</emphasis> is visible at issue location.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>User Data</term>
<listitem>
<simpara>see VIS_ILLEGAL_FUN_ACCESS</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
<simpara>For type, variable and function visibility issues the following changes have to be made to solve the visibility issue:</simpara>
<table xml:id="tab:typeAccessControl" frame="all" rowsep="1" colsep="1">
<title>Type,function and variable access modifier changes for quick fixes</title>
<tgroup cols="5">
<colspec colname="col_1" colwidth="20*"/>
<colspec colname="col_2" colwidth="20*"/>
<colspec colname="col_3" colwidth="20*"/>
<colspec colname="col_4" colwidth="20*"/>
<colspec colname="col_5" colwidth="20*"/>
<tbody>
<row>
<entry align="center" valign="top" morerows="1"><simpara><emphasis role="strong">Access Modifier</emphasis></simpara></entry>
<entry align="center" valign="top" namest="col_2" nameend="col_5"><simpara><emphasis role="strong">Accessible From</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><emphasis role="strong">Module</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><emphasis role="strong">Project</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Vendor</emphasis></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">World</emphasis></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><literal>private</literal></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>export project</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>export public@Internal</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>export public</literal></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><literal>project</literal></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>export project</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>export public@Internal</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>export public</literal></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><literal>export project</literal></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>export public@Internal</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>export public</literal></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><literal>export public@Internal</literal></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>export public</literal></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><literal>export public</literal></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="left" valign="top"><simpara><literal>export public</literal></simpara></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section xml:id="sec:Classifier_Issues">
<title>Classifier Issues</title>
<variablelist>
<varlistentry>
<term>CLF_EXTEND_FINAL</term>
<listitem>
<simpara><literal>Cannot extend final class <emphasis>C</emphasis>.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Remove <literal>@Final</literal> annotation in class <emphasis>C</emphasis></simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mo>¬</mo><mi>C</mi><mo>.</mo><mi>f</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>l</mi></math></simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_OBSERVABLE_MISSING</term>
<listitem>
<simpara><literal>Class <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> extends observable class <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math> and must therefore be annotated with @Observable.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Add <literal>@Obervable</literal> annotation in class <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math></simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0.</mn></msub><mi>o</mi><mi>b</mi><mi>s</mi><mi>e</mi><mi>r</mi><mi>v</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi></math></simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_OVERRIDE_ANNOTATION</term>
<listitem>
<simpara><literal>The <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> overriding <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math> must be annotated with @Override.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Add <literal>@Override</literal> annotation to <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math></simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Label</term>
<listitem>
<simpara><literal>Add @Override</literal></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0.</mn></msub><mi>o</mi><mi>v</mi><mi>e</mi><mi>r</mi><mi>r</mi><mi>i</mi><mi>d</mi><mi>e</mi></math></simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_OVERRIDE_FINAL</term>
<listitem>
<simpara><literal>The <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> cannot override final <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math>.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Remove <literal>@Final</literal> annotation in <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math></simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mo>¬</mo><msub><mi>e</mi><mn>1.</mn></msub><mi>f</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>l</mi></math></simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_OVERRIDE_VISIBILITY</term>
<listitem>
<simpara><literal>The <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> cannot reduce the visibility of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math>.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Set access modifier of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> to access modifier of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math></simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0.</mn></msub><mi>a</mi><mi>c</mi><mi>c</mi><mo>=</mo><mo>=</mo><msub><mi>e</mi><mn>1.</mn></msub><mi>a</mi><mi>c</mi><mi>c</mi></math></simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_OVERRIDE_NON_EXISTENT</term>
<listitem>
<simpara><literal>The <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math> must override or implement a <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> from a super class, consumed role or implemented interface.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Remove <literal>@Override</literal> annotation in <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math></simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Label</term>
<listitem>
<simpara><literal>Remove @Override</literal></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mo>¬</mo><msub><mi>e</mi><mn>1.</mn></msub><mi>o</mi><mi>v</mi><mi>e</mi><mi>r</mi><mi>r</mi><mi>i</mi><mi>d</mi><mi>e</mi></math></simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_REDEFINED_TYPE_NOT_SAME_TYPE</term>
<listitem>
<simpara><literal>Type of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> must equal type of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math> <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>2</mn></msub></math>.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Set declared type of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> to declared type of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>2</mn></msub></math></simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>τ</mi><msub><mi>e</mi><mn>0</mn></msub><mo>=</mo><msub><mi>e</mi><mn>2</mn></msub></math></simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_REDEFINED_MEMBER_TYPE_INVALID</term>
<listitem>
<simpara><literal>Type of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> does not conform to <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>2</mn></msub></math> <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math>: <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>3</mn></msub></math>.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Set declared type of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> to declared type of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math></simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>τ</mi><msub><mi>e</mi><mn>0</mn></msub><mo>=</mo><msub><mi>e</mi><mn>1</mn></msub></math></simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_REDEFINED_METHOD_TYPE_CONFLICT</term>
<listitem>
<simpara><literal>Signature of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> does not conform to <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math> <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>2</mn></msub></math>: <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>3</mn></msub></math>.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Set declared type of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> to declared type of <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>2</mn></msub></math></simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>τ</mi><msub><mi>e</mi><mn>0</mn></msub><mo>=</mo><msub><mi>e</mi><mn>2</mn></msub></math></simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_MISSING_IMPLEMENTATION</term>
<listitem>
<simpara><literal>Class <emphasis>C</emphasis> must either be defined abstract or implement <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi></math>.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Declare <emphasis>C</emphasis> as abstract</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>C</mi><mo>.</mo><mi>a</mi><mi>b</mi><mi>s</mi><mi>t</mi><mi>r</mi><mi>a</mi><mi>c</mi><mi>t</mi></math></simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_ABSTRACT_BODY</term>
<listitem>
<simpara><literal>Abstract methods do not specify a body.</literal> for method <emphasis>M</emphasis></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Remove abstract annotation from method.</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mo>¬</mo><mi>M</mi><mo>.</mo><mi>a</mi><mi>b</mi><mi>s</mi><mi>t</mi><mi>r</mi><mi>a</mi><mi>c</mi><mi>t</mi></math></simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_ABSTRACT_MISSING</term>
<listitem>
<simpara><literal>The abstract <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math> in class <emphasis>C</emphasis> can only be defined in an abstract class.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Declare <emphasis>C</emphasis> as abstract</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>C</mi><mo>.</mo><mi>a</mi><mi>b</mi><mi>s</mi><mi>t</mi><mi>r</mi><mi>a</mi><mi>c</mi><mi>t</mi></math></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Multi appliable</term>
<listitem>
<simpara>false</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_MISSING_BODY</term>
<listitem>
<simpara><literal>The <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math> has to have either a body or must be defined abstract.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Declare <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math> as abstract</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1.</mn></msub><mi>a</mi><mi>b</mi><mi>s</mi><mi>t</mi><mi>r</mi><mi>a</mi><mi>c</mi><mi>t</mi></math></simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_EXT_EXTERNAL_N4JSD</term>
<listitem>
<simpara><literal><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> declared as external have to be placed in a file with file extension ’n4jsd’.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Remove external annotation</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mo>¬</mo><msub><mi>e</mi><mn>0.</mn></msub><mi>e</mi><mi>x</mi><mi>t</mi><mi>e</mi><mi>r</mi><mi>n</mi><mi>a</mi><mi>l</mi></math></simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
<listitem>
<simpara>Change module file extension to n4jsd</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara>module file extension is n4jsd</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>CLF_NOT_EXPORTED_NOT_PRIVATE</term>
<listitem>
<simpara><literal>A <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> with visibility <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>1</mn></msub></math> must be marked as exported.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Export <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math></simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>e</mi><mn>0</mn></msub></math> is exported</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="sec:Function_Issues">
<title>Function Issues</title>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>FUN_BLOCK</simpara>
</entry>
<entry>
<simpara><literal>Functions declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.</literal> with function <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>F</mi></math></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Change function declaration to function expression</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mtable><mtr><mtd/><mtd><mo></mo><mstyle mathvariant="monospace"><mtext>Variable</mtext></mstyle><mi> </mi><mi>v</mi><mo></mo><mi>F</mi><mo>.</mo><mi>v</mi><mi>e</mi><mi>e</mi><mi>:</mi></mtd></mtr><mtr><mtd/><mtd><mspace width="3.0em"/><mi>v</mi><mo>.</mo><mi>n</mi><mi>a</mi><mi>m</mi><mi>e</mi><mo>=</mo><mi>F</mi></mtd></mtr><mtr><mtd/><mtd><mspace width="3.0em"/><mo></mo><mi>v</mi><mo>.</mo><mi>e</mi><mi>x</mi><mi>p</mi><mi>r</mi><mo>.</mo><mi>μ</mi><mo>=</mo><mstyle mathvariant="monospace"><mtext>FunctionExpression</mtext></mstyle></mtd></mtr><mtr><mtd/><mtd><mspace width="3.0em"/><mo></mo><mi>v</mi><mo>.</mo><mi>e</mi><mi>x</mi><mi>p</mi><mi>r</mi><mo>.</mo><mi>n</mi><mi>a</mi><mi>m</mi><mi>e</mi><mo>=</mo><mi>F</mi><mo>.</mo><mi>n</mi><mi>a</mi><mi>m</mi><mi>e</mi><mo>,</mo><mi>v</mi><mo>.</mo><mi>e</mi><mi>x</mi><mi>p</mi><mi>r</mi><mo>.</mo><mi>b</mi><mi>o</mi><mi>d</mi><mi>y</mi><mo>=</mo><mi>F</mi><mo>.</mo><mi>b</mi><mi>o</mi><mi>d</mi><mi>y</mi></mtd></mtr></mtable></math>
<variablelist>
<varlistentry>
<term>Description</term>
<listitem>
<simpara>Change function declaration to function expression assigned to variable of the function name</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="sec:Syntax_Issues">
<title>Syntax Issues</title>
<variablelist>
<varlistentry>
<term>AST_STR_FUN_NOT_NESTED</term>
<listitem>
<simpara><literal>Functions must only be declared on script level or as part of other expressions</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Change function declaration to function expression assigned to variable of the function name</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mtable><mtr><mtd/><mtd><mo></mo><mstyle mathvariant="monospace"><mtext>Variable</mtext></mstyle><mi> </mi><mi>v</mi><mo></mo><mi>F</mi><mo>.</mo><mi>v</mi><mi>e</mi><mi>e</mi><mi>:</mi></mtd></mtr><mtr><mtd/><mtd><mspace width="3.0em"/><mi>v</mi><mo>.</mo><mi>n</mi><mi>a</mi><mi>m</mi><mi>e</mi><mo>=</mo><mi>F</mi></mtd></mtr><mtr><mtd/><mtd><mspace width="3.0em"/><mo></mo><mi>v</mi><mo>.</mo><mi>e</mi><mi>x</mi><mi>p</mi><mi>r</mi><mo>.</mo><mi>μ</mi><mo>=</mo><mstyle mathvariant="monospace"><mtext>FunctionExpression</mtext></mstyle></mtd></mtr><mtr><mtd/><mtd><mspace width="3.0em"/><mo></mo><mi>v</mi><mo>.</mo><mi>e</mi><mi>x</mi><mi>p</mi><mi>r</mi><mo>.</mo><mi>n</mi><mi>a</mi><mi>m</mi><mi>e</mi><mo>=</mo><mi>F</mi><mo>.</mo><mi>n</mi><mi>a</mi><mi>m</mi><mi>e</mi><mo>,</mo><mi>v</mi><mo>.</mo><mi>e</mi><mi>x</mi><mi>p</mi><mi>r</mi><mo>.</mo><mi>b</mi><mi>o</mi><mi>d</mi><mi>y</mi><mo>=</mo><mi>F</mi><mo>.</mo><mi>b</mi><mi>o</mi><mi>d</mi><mi>y</mi></mtd></mtr></mtable></math>
<variablelist>
<varlistentry>
<term>SYN_MODIFIER_BAD_ORDER</term>
<listitem>
<simpara><literal>Modifiers should appear in this order: O </literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Rearrange access modifiers</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara>Modifiers are in order O</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Description</term>
<listitem>
<simpara>Reorder the access modifiers to match the N4JS compliant order.</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="sec:Conversion_Issues">
<title>Conversion Issues</title>
</section>
<section xml:id="sec:Type_Issues">
<title>Type Issues</title>
</section>
<section xml:id="sec:Expression_Issues">
<title>Expression Issues</title>
<variablelist>
<varlistentry>
<term>EXP_WRONG_NUMBER_OF_TYPEARGS</term>
<listitem>
<simpara><literal>Incorrect number of type arguments for <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>T</mi></math> <emphasis>C</emphasis>: expected <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>t</mi><mi>p</mi><mi>c</mi><mi>o</mi><mi>u</mi><mi>n</mi><mi>t</mi></math>, got <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>t</mi><mi>a</mi><mi>c</mi><mi>o</mi><mi>u</mi><mi>n</mi><mi>t</mi></math>.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Remove superfluous arguments</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>t</mi><mi>a</mi><mi>c</mi><mi>o</mi><mi>u</mi><mi>n</mi><mi>t</mi><mo>&gt;</mo><mi>t</mi><mi>p</mi><mi>c</mi><mi>o</mi><mi>u</mi><mi>n</mi><mi>t</mi></math></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>t</mi><mi>a</mi><mi>c</mi><mi>o</mi><mi>u</mi><mi>n</mi><mi>t</mi><mo>=</mo><mi>t</mi><mi>p</mi><mi>c</mi><mi>o</mi><mi>u</mi><mi>n</mi><mi>t</mi></math></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Description</term>
<listitem>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>EXP_NUM_OF_ARGS_TOO_MANY</term>
<listitem>
<simpara><literal>Incorrect number of arguments: expected <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>f</mi><mi>p</mi><mi>c</mi><mi>o</mi><mi>u</mi><mi>n</mi><mi>t</mi></math>, got <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>a</mi><mi>r</mi><mi>g</mi><mi>c</mi><mi>o</mi><mi>u</mi><mi>n</mi><mi>t</mi></math>.</literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Remove superfluous arguments</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>a</mi><mi>r</mi><mi>g</mi><mi>c</mi><mi>o</mi><mi>u</mi><mi>n</mi><mi>t</mi><mo>&gt;</mo><mi>f</mi><mi>p</mi><mi>c</mi><mi>o</mi><mi>u</mi><mi>n</mi><mi>t</mi></math></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>a</mi><mi>r</mi><mi>g</mi><mi>c</mi><mi>o</mi><mi>u</mi><mi>n</mi><mi>t</mi><mo>=</mo><mi>f</mi><mi>p</mi><mi>c</mi><mi>o</mi><mi>u</mi><mi>n</mi><mi>t</mi></math></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Description</term>
<listitem>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>EXP_CAST_UNNECESSARY</term>
<listitem>
<simpara><literal>Unnecessary cast from <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>S</mi></math> to <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>T</mi></math></literal></simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Remove cast</simpara>
<variablelist>
<varlistentry>
<term>Precondition</term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Postcondition</term>
<listitem>
<simpara>cast removed</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>Description</term>
<listitem>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="sec:Super_Keyword_Issues">
<title>Super Keyword Issues</title>
</section>
</section>
</section>
<section xml:id="sec:Quick_Assist">
<title>Quick Assist</title>
</section>
<section xml:id="sec:Cleanup_Operations" role="language-n4js">
<title>Cleanup Operations</title>
<section xml:id="sec:Formatting">
<title>Formatting</title>
</section>
<section xml:id="sec:Organize_Imports">
<title>Organize Imports</title>
<simpara>Import statements can be cleaned up or automatically inserted by invoking <literal>Organize Imports</literal>. <literal>Organize Imports</literal> is available in the context menu <literal>Source / Organise imports</literal> , in menu <literal>Source &gt; Organize imports</literal> or by hitting <keycap>Cmd</keycap> + <keycap>Option</keycap> +<keycap>O</keycap> (Win/Linux - <keycap>Ctrl</keycap> +<keycap>Alt</keycap> +<keycap>O</keycap>).</simpara>
<simpara>For a valid file without errors, this will result in the following actions:</simpara>
<itemizedlist>
<listitem>
<simpara>Unused explicit imports will be removed.</simpara>
</listitem>
<listitem>
<simpara>Unused wildcard imports will be removed.</simpara>
</listitem>
<listitem>
<simpara>In each import statement the imported elements will be lexicographically sorted depending on the imported element’s name.</simpara>
</listitem>
<listitem>
<simpara>All import statements will be lexicographically sorted depending on the module specifier as major and the element name as minor key.</simpara>
</listitem>
<listitem>
<simpara>All import statements will be moved to the top of the file.</simpara>
</listitem>
</itemizedlist>
<simpara>For a file with error-conditions of unresolved references, this will result in the automatic actions:</simpara>
<itemizedlist>
<listitem>
<simpara>All ambiguous wildcard imports will be presented in one dialog, requesting the user to resolve the ambiguity.</simpara>
</listitem>
<listitem>
<simpara>Each uniquely resolvable <literal>unresolved Classifier</literal> will be added by a named import. The search scope is limited to the dependencies declared in the current project-setup.</simpara>
</listitem>
</itemizedlist>
<simpara>No action will be taken, if &#8230;&#8203;</simpara>
<itemizedlist>
<listitem>
<simpara>a classifier with name <literal>X</literal> is already imported by name from a module <literal>A</literal> and a unknown member of this classifier is marked. Even though the import of <literal>X</literal> from a different module <literal>B</literal> could remove this error, the semantic consequences could not be evaluated. The state will be left as-is.</simpara>
</listitem>
</itemizedlist>
<simpara>If more then one option leads to a possible resolution the situation should be clarified using quick-fixes, e.g. if &#8230;&#8203;</simpara>
<itemizedlist>
<listitem>
<simpara>more then one module provides an element, which would render a formerly unresolved reference to be valid.</simpara>
</listitem>
<listitem>
<simpara>for a wildcard-imported element <literal>X</literal> there are unknown members and a different module provides an element <literal>X</literal> containing the missing members. In such a case a named import of <literal>X</literal> would be proposed, optionally using an alias.</simpara>
</listitem>
</itemizedlist>
</section>
</section>
</chapter>
<chapter xml:id="_wizards">
<title>Wizards</title>
<warning>
<simpara>Some descriptions may be outdated.</simpara>
</warning>
<warning>
<simpara>All requirement sections are not linked to real issues. They were left here as an example and to complete the issues.</simpara>
</warning>
<section xml:id="sec:N4JS_Project_Wizard">
<title>N4JS Project Wizard</title>
<simpara>Wizard creates a new N4JS project.</simpara>
<simpara>The following information is to be specified by the user:</simpara>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>Project Name</simpara>
</entry>
<entry>
<simpara>string, name of project</simpara>
</entry>
</row>
<row>
<entry>
<simpara>Default Location</simpara>
</entry>
<entry>
<simpara>boolean, true by default</simpara>
</entry>
</row>
<row>
<entry>
<simpara>Location</simpara>
</entry>
<entry>
<simpara>string, computed default location, if user set location then default location flag must be false</simpara>
</entry>
</row>
<row>
<entry>
<simpara>Project Type</simpara>
</entry>
<entry>
<simpara>enumeration, the type of the new project</simpara>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<simpara>The following files are to be created:</simpara>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>Project Folder</simpara>
</entry>
<entry>
<simpara>with name of project at given location</simpara>
</entry>
</row>
<row>
<entry>
<simpara>Manifest</simpara>
</entry>
<entry>
<simpara>with default project structure and name</simpara>
</entry>
</row>
<row>
<entry>
<simpara>Source Folder</simpara>
</entry>
<entry>
<simpara>default source folder (src)</simpara>
</entry>
</row>
<row>
<entry>
<simpara>Output Folder</simpara>
</entry>
<entry>
<simpara>default source folder (src-gen)</simpara>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section xml:id="sec:Empty_N4JS_File">
<title>Empty N4JS File</title>
<simpara>The following information is to be specified by the user:</simpara>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>Package Name</simpara>
</entry>
<entry>
<simpara>dot separated name of the package, empty by default (or set to the package/folder selected in the navigator)</simpara>
</entry>
</row>
<row>
<entry>
<simpara>Module Name</simpara>
</entry>
<entry>
<simpara>string, name of the module – must be a valid module name without extension</simpara>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<simpara>The following files are to be created:</simpara>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>Package Folder(s)</simpara>
</entry>
<entry>
<simpara>if folders representing package structure do not exist, they are to be created</simpara>
</entry>
</row>
<row>
<entry>
<simpara>Module File</simpara>
</entry>
<entry>
<simpara>empty file with name of module and extension <literal>n4js</literal> in the appropriate package folder</simpara>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section xml:id="sec:Empty_JS_File">
<title>Empty JS File</title>
<simpara>Similar to <link linkend="sec:Empty_N4JS_File">Empty N4JS File</link> but with the file extension <literal>js</literal>.</simpara>
<section xml:id="sec:N4JS_Class_File_Wizard">
<title>N4JS Class Wizard</title>
<simpara>It is recommended to define a single classifier in a file, the name of the classifier should have the same name as the file. Based on that assumption, file wizards are provided for N4JS classes, interfaces and enumerations.</simpara>
<informalfigure role="center">
<mediaobject>
<imageobject>
<imagedata fileref="chapters/06_wizards/fig/newclasswizard.png" width="60%" scalefit="1"/>
</imageobject>
<textobject><phrase>newclasswizard</phrase></textobject>
</mediaobject>
</informalfigure>
</section>
<section xml:id="field-properties">
<title>Field Properties</title>
<simpara><anchor xml:id="Class_File_Wizard-Project_Field" xreflabel="[Class_File_Wizard-Project_Field]"/> The New N4JS Class wizard offers following fields:</simpara>
<variablelist>
<varlistentry>
<term>Project</term>
<listitem>
<simpara>Specifies the containing project.</simpara>
</listitem>
</varlistentry>
</variablelist>
<requirement xml:id="GH-1413">
<title>Project constraints</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Project constraints</link> (ver. 1)</simpara>
<simpara>
</simpara>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>Constraints</simpara>
</entry>
<entry>
<orderedlist numeration="arabic">
<listitem>
<simpara>It is a path of a valid project in the current workspace</simpara>
</listitem>
<listitem>
<simpara>This field must not be empty</simpara>
</listitem>
</orderedlist>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</requirement>
<requirement xml:id="GH-1413">
<title>Project browse button</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Project browse button</link> (ver. 1)</simpara>
<simpara>
Browse Button::
Browsing only allows the selection of projects in the current workspace. Project creation is not possible.</simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>Project initial selection inference</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Project initial selection inference</link> (ver. 1)</simpara>
<simpara>
Initial selection::
The project should be derived from the initial selection.</simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>Project content assist</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Project content assist</link> (ver. 1)</simpara>
<simpara>
Content Assist::
Workspace projects</simpara>
</requirement>
<variablelist xml:id="Class_File_Wizard-Source_Folder_Field">
<varlistentry>
<term>Source folder</term>
<listitem>
<simpara>Specifies the containing source folder.</simpara>
</listitem>
</varlistentry>
</variablelist>
<requirement xml:id="GH-1413">
<title>Source folder constraints</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Source folder constraints</link> (ver. 1)</simpara>
<simpara>
</simpara>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>Constraints</simpara>
</entry>
<entry>
<orderedlist numeration="arabic">
<listitem>
<simpara>The folder is listed as source folder in the project manifest</simpara>
</listitem>
<listitem>
<simpara>This field must not be empty.</simpara>
</listitem>
<listitem>
<simpara>The name is a valid path that means each segment of the path matches the following expression:</simpara>
<programlisting language="ebnf" linenumbering="unnumbered">[a-zA-z_](([\\.][a-zA-z_0-9\\-])|[a-zA-z_0-9\\-])*</programlisting>
</listitem>
</orderedlist>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</requirement>
<requirement xml:id="GH-1413">
<title>Source folder browse button</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Source folder browse button</link> (ver. 1)</simpara>
<simpara>
Browse Button::
Browsing only allows the selection of source folders in the selected project. The dialog should provide a list of all source folders of the selected project. This includes nested source folders. A list element is a relative path of a source folder in the project.</simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>Source folder initial selection inference</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Source folder initial selection inference</link> (ver. 1)</simpara>
<simpara>
Initial selection::
The source folder field should be derived from the initial selection</simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>Source folder content assist</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Source folder content assist</link> (ver. 1)</simpara>
<simpara>
Content Assist::
source folders defined by the project manifest</simpara>
</requirement>
<variablelist xml:id="Class_File_Wizard-Module_Specifier_Field">
<varlistentry>
<term>Module specifier</term>
<listitem>
<simpara>Specifies the module specifier. May only specify a module container (a folder) but could also include module name. May also be an already existing module. Does not include the file extension.</simpara>
</listitem>
</varlistentry>
</variablelist>
<requirement xml:id="GH-1413">
<title>Module specifier constraints</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Module specifier constraints</link> (ver. 1)</simpara>
<simpara>
The specifier is a valid module specifier that is
- Segments are separated by the path separator
- No separator at the beginning or end</simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>Module specifier completion</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Module specifier completion</link> (ver. 1)</simpara>
<simpara>
Manually inserting a specifier ending with a separator is valid.
It is then interpreted as base path for the full module specifier automatically completed by the class name. (cf. grey suffix)</simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>Module specifier grey suffix</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Module specifier grey suffix</link> (ver. 1)</simpara>
<simpara>
A grey suffix should suggest the attached class name as module name if the specifier only specifies a base path.</simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>Module specifier browse button</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Module specifier browse button</link> (ver. 1)</simpara>
<simpara>
Browsing only allows the selection of modules or module containers in the selected source folder. The browse dialog has to offer a module container creation functionality. In contrast to the other parts of the wizard, the creation of module containers in this dialog should be immediate and on file system level. This is important to comply with the conceptual model of eclipse and the operating system.</simpara>
<simpara>When inserting a non-existent path in the text input and opening the browse dialog, an additional dialog should ask the user whether he wants to create this structure on the file system. If he denies, the dialog shows the selection to the level it already exists on the file system.</simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>Module specifier initial selection inference</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Module specifier initial selection inference</link> (ver. 1)</simpara>
<simpara>
The module specifier should be derived from the initial selection by using the container of the selection as initial module container</simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>Module specifier content assist</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Module specifier content assist</link> (ver. 1)</simpara>
<simpara>
Modules in the selected source folder</simpara>
</requirement>
<simpara role="todo">For now the spec doesn&#8217;t specify any constraints for module specifiers</simpara>
<variablelist>
<varlistentry>
<term>Class name</term>
<listitem>
<simpara>Specifies the class name.</simpara>
</listitem>
</varlistentry>
</variablelist>
<requirement xml:id="GH-1413">
<title>Class name basic constraints</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Class name basic constraints</link> (ver. 1)</simpara>
<simpara>
</simpara>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>Constraints</simpara>
</entry>
<entry>
<orderedlist numeration="arabic">
<listitem>
<simpara>The name is a valid n4js class identifier Must not be empty</simpara>
</listitem>
<listitem>
<simpara>If the target module already exists no other type with the same identifier may exist in this module</simpara>
</listitem>
</orderedlist>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</requirement>
<requirement xml:id="GH-1413">
<title>Class name conflict validation</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Class name conflict validation</link> (ver. 1)</simpara>
<simpara>
If the target module already exists no other type with the same identifier may exist in this module</simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>File type options</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">File type options</link> (ver. 1)</simpara>
<simpara>
Definition file (.n4jsd):: Specifies whether the class should be declared external. This option changes the file extension to <literal>n4jsd</literal></simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>Access modifier constraints</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Access modifier constraints</link> (ver. 1)</simpara>
<simpara>
Specifies the access modifiers of the class. One of <literal>public</literal>, <literal>project</literal>, <emphasis role="strong">private</emphasis>. <literal>@Internal</literal> is an additionally selectable option.</simpara>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>Constraints</simpara>
</entry>
<entry>
<orderedlist numeration="arabic">
<listitem>
<simpara>One of the provided access modifiers has to be selected</simpara>
</listitem>
<listitem>
<simpara>The <literal>@Internal</literal> option is only selectable in case of <literal>public</literal> or <literal>project</literal></simpara>
</listitem>
</orderedlist>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</requirement>
<variablelist>
<varlistentry>
<term>Other modifiers</term>
<listitem>
<simpara>Specifies other modifiers and annotations of the class. The non-exclusive options are <literal>@Final</literal> and <emphasis role="strong">@N4JS</emphasis></simpara>
</listitem>
</varlistentry>
</variablelist>
<requirement xml:id="GH-1413">
<title>Other modifiers constraints</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Other modifiers constraints</link> (ver. 1)</simpara>
<simpara>
Constraints::
1. <emphasis role="strong">@N4JS</emphasis> annotation is only enabled and selectable if the Definition File box is checked</simpara>
</requirement>
<variablelist>
<varlistentry>
<term>Super class</term>
<listitem>
<simpara>Specifies the super class</simpara>
</listitem>
</varlistentry>
</variablelist>
<requirement xml:id="GH-1413">
<title>Super class constraints</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Super class constraints</link> (ver. 1)</simpara>
<simpara>
</simpara>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>Constraints</simpara>
</entry>
<entry>
<orderedlist numeration="arabic">
<listitem>
<simpara>A valid absolute class specifier that is a module specifier and a class name separated by a dot.</simpara>
</listitem>
</orderedlist>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</requirement>
<requirement xml:id="GH-1413">
<title>Super class browse button</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Super class browse button</link> (ver. 1)</simpara>
<simpara>
</simpara>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>Browse Button</simpara>
</entry>
<entry>
<simpara>Browsing allows the selection of all classes in the current workspace with modifiable source and visible classes with unmodifiable sources.</simpara>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</requirement>
<requirement xml:id="GH-1413">
<title>Super class content assist</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Super class content assist</link> (ver. 1)</simpara>
<simpara>
Content Assist::
All classes matching mentioned criteria</simpara>
</requirement>
<variablelist xml:id="Class_File_Wizard-Interfaces_Field">
<varlistentry>
<term>Interfaces</term>
<listitem>
<simpara>Specifies the implemented interfaces of the class</simpara>
</listitem>
</varlistentry>
</variablelist>
<requirement xml:id="GH-1413">
<title>Interfaces constraints</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Interfaces constraints</link> (ver. 1)</simpara>
<simpara>
1. A valid absolute interface specifier that is a module specifier and an interface name separated by a dot.</simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>Interfaces browsing</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Interfaces browsing</link> (ver. 1)</simpara>
<simpara>
Add Button:: Browsing allows the selection of all interfaces in the current workspace with modifiable source and visible interfaces with unmodifiable sources.</simpara>
<variablelist>
<varlistentry>
<term>Remove Button</term>
<listitem>
<simpara>Removes the selected interface from the list. Disabled if nothing is selected.</simpara>
</listitem>
</varlistentry>
</variablelist>
</requirement>
<requirement xml:id="GH-1413">
<title>Interfaces content assist</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Interfaces content assist</link> (ver. 1)</simpara>
<simpara>
Text input is available by clicking in empty space at the end of the list. Content Assist provides all interfaces matching mentioned criteria.</simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>Create method stubs</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Create method stubs</link> (ver. 1)</simpara>
<simpara>
Specifies if the wizard should generate method stubs for all abstract methods of the newly generated class. That are abstract super class methods or methods that need to be implemented by the class to conform to the selected interfaces.</simpara>
</requirement>
<requirement xml:id="GH-1413">
<title>Create method stub conflict detection</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Create method stub conflict detection</link> (ver. 1)</simpara>
<simpara>
If the selected interfaces are impossible to implement (e.g. method name overlap with unrelated parameter types) this option needs to be disabled and a warning needs to be shown.</simpara>
</requirement>
<simpara role="todo">Shouldn&#8217;t this be a constraint of the selected interfaces? (Never generate invalid code)</simpara>
</section>
<section xml:id="visibility-issues-or-final-super-classes">
<title>Visibility issues or <literal>@Final</literal> super classes</title>
<requirement xml:id="GH-1413">
<title>Visibility issue conflict solving</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Visibility issue conflict solving</link> (ver. 1)</simpara>
<simpara>
</simpara>
<simpara>By allowing the user to select invisible interfaces and super classes or unextendable <literal>@Final</literal>-annotated super classes, accessability issues may come up. The goal is to never generate a file containing invalid code. To accomplish this, conflicts must get solved before the file is generated.</simpara>
<simpara>The slight limitation of the selection of interfaces and classes to elements from modifiable sources (cf. <link linkend="Req-GH-1413">super class browse button</link>) allows to solve all possibly occurring visibility issues.</simpara>
<simpara>If the modifications by finishing the wizard do imply changes different from insertions and creations, a compare view is to be shown, giving the user an overview of the needed changes before they’re applied.</simpara>
</requirement>
</section>
<section xml:id="generation-1">
<title>Generation</title>
<requirement xml:id="GH-1413">
<title>Wizard generation</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Wizard generation</link> (ver. 1)</simpara>
<simpara>
The following changes are to be made by the wizard:</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Create a new file containing the new class (optional)</simpara>
</listitem>
<listitem>
<simpara>Insert the new class into the specified module</simpara>
</listitem>
<listitem>
<simpara>Change the source module of the super class to fix possible visibility issues (optional)</simpara>
</listitem>
<listitem>
<simpara>Change the source module of the interfaces to fix possible visibility issues (optional)</simpara>
</listitem>
<listitem>
<simpara>Change the project manifest to add a new source folder (optional) or add new project dependencies (optional)</simpara>
</listitem>
</orderedlist>
</requirement>
</section>
<section xml:id="preview-1">
<title>Preview</title>
<requirement xml:id="GH-1413">
<title>Generation preview</title>
<simpara>
<anchor xml:id="Req-GH-1413" xreflabel="[Req-GH-1413]"/>
<emphasis role="strong">Requirement: GH-1413:</emphasis>
<link linkend="Req-GH-1413">Generation preview</link> (ver. 1)</simpara>
<simpara>
On the right of the wizard form a preview window should be provided. It should preview the full path of the generated file and all code that is generated with the options of the wizard. Changes should be updated in realtime as the user is choosing different options.</simpara>
</requirement>
</section>
</section>
<section xml:id="sec:N4JS_Interface_Wizard">
<title>Interface Wizard</title>
<simpara>The N4JS interface wizards is strongly similar to the <link linkend="sec:N4JS_Class_File_Wizard">N4JS Class Wizard</link>. The following paragraph is meant to state the differences and will strongly refer to the N4JS Class Wizard as a lot of properties stay the same.</simpara>
<informalfigure role="center">
<mediaobject>
<imageobject>
<imagedata fileref="chapters/06_wizards/fig/newinterfacewizard.png" width="60%" scalefit="1"/>
</imageobject>
<textobject><phrase>newinterfacewizard</phrase></textobject>
</mediaobject>
</informalfigure>
<section xml:id="field-properties-1">
<title>Field Properties</title>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>Project</simpara>
</entry>
<entry>
<simpara>Specifies the containing project.
See <link linkend="Class_File_Wizard-Project_Field">N4JS Class Wizard Project</link>.</simpara>
</entry>
</row>
<row>
<entry>
<simpara>Source Folder</simpara>
</entry>
<entry>
<simpara>Specifies the containing source folder.<?asciidoc-br?>
See <link linkend="Class_File_Wizard-Source_Folder_Field">N4JS Class Wizard Source Folder</link></simpara>
</entry>
</row>
<row>
<entry>
<simpara>Module Specifier</simpara>
</entry>
<entry>
<simpara>Specifies the containing source folder.<?asciidoc-br?>
See <link linkend="Class_File_Wizard-Module_Specifier_Field">N4JS Class Wizard Module specifier</link></simpara>
</entry>
</row>
<row>
<entry>
<simpara>Interface name</simpara>
</entry>
<entry>
<simpara>Specifies the name of the interface<?asciidoc-br?></simpara>
<variablelist>
<varlistentry>
<term>Constraints</term>
<listitem>
<orderedlist numeration="arabic">
<listitem>
<simpara>The name is a valid n4js interface identifier</simpara>
</listitem>
<listitem>
<simpara>Must not be empty</simpara>
</listitem>
<listitem>
<simpara>If the target module already exists, no other type with the same identifier may exist in this module</simpara>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
</entry>
</row>
<row>
<entry>
<simpara>Definition file (.n4jsd)</simpara>
</entry>
<entry>
<simpara>Specifies whether the interface should be declared external. This option changes the file extension to <literal>n4jsd</literal> .</simpara>
</entry>
</row>
<row>
<entry>
<simpara>Access Modifiers</simpara>
</entry>
<entry>
<simpara>Specifies the interface’s access modifiers</simpara>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<simpara>See <link linkend="Req-GH-1413">N4JS Class Wizard Modifier Field</link> except for the following point:</simpara>
<simpara><emphasis>Other than classes, interfaces must not be declared as <literal>@Final</literal>, therefore this option is removed.</emphasis></simpara>
<variablelist>
<varlistentry>
<term>Interfaces</term>
<listitem>
<simpara>The interfaces the interface is implementing</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>See <link linkend="Class_File_Wizard-Interfaces_Field">N4JS Class Wizard Interfaces field</link> except for the following point:</simpara>
<simpara><emphasis>Other than classes interfaces must not be declared as <literal>@Final</literal>, therefore this option is removed.</emphasis></simpara>
<variablelist>
<varlistentry>
<term>Create method stubs</term>
<listitem>
<simpara>Specifies if the wizard should generate method stubs for all abstract methods of the newly generated class. That are abstract super interface methods or methods that need to be implemented by the interface to conform to the given interfaces.</simpara>
<simpara>If the selected interfaces are impossible to implement (e.g. method name overlap with unrelated parameter types) this option needs to be disabled and a warning needs to be shown.</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara role="todo">Shouldn&#8217;t this be a constraint of the selected interfaces? (Never generate invalid code)</simpara>
</section>
<section xml:id="visibility-issues">
<title>Visibility Issues</title>
<simpara>As the user might select invisible interfaces, the wizard has to solve these visibility issues. See ** for details.</simpara>
</section>
<section xml:id="import-naming-conflicts">
<title>Import naming conflicts</title>
<simpara>As the user may select identically named interfaces, the wizard has to solve these naming conflicts. See
<emphasis role="strong"><link linkend="Req-GH-1413">Class Wizard Visibility Issues</link></emphasis> for details.</simpara>
</section>
<section xml:id="generation-2">
<title>Generation</title>
<orderedlist numeration="arabic">
<listitem>
<simpara>Create a new file at the given module specifier location (optional)</simpara>
</listitem>
<listitem>
<simpara>Insert the new interface into the specified module</simpara>
</listitem>
<listitem>
<simpara>Change the source module of the super class to fix visibility issues (optional)</simpara>
</listitem>
<listitem>
<simpara>Change the source module of the interfaces to fix possible visibility issues (optional)</simpara>
</listitem>
<listitem>
<simpara>Change the project manifest to add a possibly new source folder (optional) or add new project dependencies (optional)</simpara>
</listitem>
</orderedlist>
</section>
<section xml:id="preview-2">
<title>Preview</title>
<simpara>The Interface Wizard should provided a preview. (See <link linkend="sec:N4JS_Wizards:Wizard_Preview">Wizard Preview</link>)</simpara>
</section>
</section>
<section xml:id="sec:N4JS_Enum_File_Wizard">
<title>Enum Wizard</title>
<simpara>The N4JS Enum File wizards provides the user a wizard to create enums. When speaking of enums in this context ordinary enums as specified in the N4JS Specification are meant.</simpara>
<section xml:id="field-properties-2">
<title>Field Properties</title>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>Project</simpara>
</entry>
<entry>
<simpara>Specifies the containing project.<?asciidoc-br?>
See <link linkend="Class_File_Wizard-Project_Field">N4JS Class Wizard Project</link></simpara>
</entry>
</row>
<row>
<entry>
<simpara>Source Folder</simpara>
</entry>
<entry>
<simpara> Specifies the containing source folder.<?asciidoc-br?>
See <link linkend="Class_File_Wizard-Source_Folder_Field">N4JS Class Wizard Source Folder</link></simpara>
</entry>
</row>
<row>
<entry>
<simpara>Module Specifier</simpara>
</entry>
<entry>
<simpara>Specifies the containing source folder. See <link linkend="Class_File_Wizard-Module_Specifier_Field">N4JS Class Wizard Module specifier</link></simpara>
</entry>
</row>
<row>
<entry>
<simpara>Enum name</simpara>
</entry>
<entry>
<simpara>Specifies the name of the interface<?asciidoc-br?></simpara>
<variablelist>
<varlistentry>
<term>Constraints</term>
<listitem>
<orderedlist numeration="arabic">
<listitem>
<simpara>The name is a valid n4js enum identifier</simpara>
</listitem>
<listitem>
<simpara>Must not be empty</simpara>
</listitem>
<listitem>
<simpara>If the target module already exists, no other type with the same identifier may exist in this module</simpara>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
</entry>
</row>
<row>
<entry>
<simpara>Modifiers</simpara>
</entry>
<entry>
<simpara>Specifies the interface’s access modifiers
+
Allows the user to select from following modifier options: <literal>public</literal>,<literal>project</literal>,<literal>private</literal>. The wizard automatically adds missing <literal>export</literal> if needed.
+
Furthermore the enum can be declared <literal>@Internal</literal> using a checkbox.</simpara>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<simpara role="todo">Should the enum wizard also provide functionality to create enum literals?</simpara>
</section>
<section xml:id="generation-3">
<title>Generation</title>
<simpara>The following changes are to be made by the wizard:</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Create a new file containing the new enum (optional, only if module doesn’t exists yet )</simpara>
</listitem>
<listitem>
<simpara>Insert the new enum into the specified module</simpara>
</listitem>
</orderedlist>
</section>
<section xml:id="preview-3">
<title>Preview</title>
<simpara>The Enum Wizard should provided a preview. (See <link linkend="sec:N4JS_Wizards:Wizard_Preview">Wizard Preview</link>)</simpara>
</section>
</section>
</chapter>
<chapter xml:id="_execution-support">
<title>Execution Support</title>
<warning>
<simpara>Parts of this document may be outdated.</simpara>
</warning>
<section xml:id="sec:Non_UI_Execution">
<title>Non-UI Execution</title>
<section xml:id="sec:Non_UI_Debugging">
<title>Non-UI Debugging</title>
<simpara>not supported yet</simpara>
</section>
</section>
<section xml:id="sec:UI_Execution">
<title>UI Execution</title>
<simpara>The N4JS IDE supports launching a file via a so called "runner". That is, a selected file is started as main
file with Node.js or Chrome, depending on the available runners.</simpara>
<warning>
<simpara>Chrome support not available yet.</simpara>
</warning>
<simpara>For testing, a file, package, or even a whole project can be executed with a "tester". In that case, instead of directly executing the selected resource with Node.js (or other runners), the "mangelhaft" framework is used to run the selected resource or all its content as tests. For test support in general, see next chapter.</simpara>
<simpara>Running or testing a resource is done via a launch configuration. This can be configured.</simpara>
<simpara>The node.js runner/tester allows for configuration of</simpara>
<itemizedlist>
<listitem>
<simpara>the NODE_MODULE path. This can be adjusted if the automatically path is not suited.</simpara>
</listitem>
<listitem>
<simpara>other environment variables (simply as key=value pairs per line)</simpara>
</listitem>
<listitem>
<simpara>node.js options to be passed as arguments to node.js</simpara>
</listitem>
<listitem>
<simpara>the system loader to be used, this is "System.js" by default</simpara>
</listitem>
</itemizedlist>
<simpara>
Since in the JavaScript world these configurations are often used, it is cumbersome, particularly for tests, to define them for every single file. Thus the N4JS IDE copies the node.js settings found in a project launch configuration to a resource specific launch configuration.</simpara>
<sidebar>
<simpara><link xl:href="https://github.com/eclipse/n4js/issues/716"><inlinemediaobject>
<imageobject>
<imagedata fileref="images/issue.svg"/>
</imageobject>
<textobject><phrase></phrase></textobject>
</inlinemediaobject> #716</link></simpara>
</sidebar>
</section>
</chapter>
<chapter xml:id="_test-support">
<title>Test Support</title>
<simpara>N4IDE provides tests support by allowing different <emphasis>TestRunner</emphasis>s to extend it with test specific functionality. This allows to support specialized and very different from each other test requirements (e.g. nodejs based tests, browser based interactive ui tests, server integration tests).</simpara>
<figure xml:id="fig:test_support_diagram">
<title>Test Support Diagram</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/09_testsupport/fig/cd_testsupport.png"/>
</imageobject>
<textobject><phrase>cd testsupport</phrase></textobject>
</mediaobject>
</figure>
<simpara>Explanation of the main components:</simpara>
<variablelist>
<varlistentry>
<term><emphasis>User Project</emphasis></term>
<listitem>
<itemizedlist>
<listitem>
<simpara>a project with production code (e.g. <literal>src</literal> folder), and test code (e.g. test folder)</simpara>
</listitem>
<listitem>
<simpara>test code may contain special language features contributed by <emphasis>Test Library</emphasis></simpara>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis>N4IDE</emphasis></term>
<listitem>
<itemizedlist>
<listitem>
<simpara>manage user project, including all test related parts (e.g. support test related code, validate some test code constraints)</simpara>
</listitem>
<listitem>
<simpara>host runner, allow its UI contributions</simpara>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Test Runner</emphasis></term>
<listitem>
<itemizedlist>
<listitem>
<simpara>contribute to N4IDE necessary elements (test results view, user test selection, test start/stop actions)</simpara>
</listitem>
<listitem>
<simpara>use N4IDE mechanisms to access user project test fragment (e.g. discover tests)</simpara>
</listitem>
<listitem>
<simpara>configure <emphasis>Test Execution Environment</emphasis></simpara>
</listitem>
<listitem>
<simpara>manage test runtime (e.g. start/stop execution environment)</simpara>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Test Execution Environment</emphasis></term>
<listitem>
<itemizedlist>
<listitem>
<simpara>hosts (directly or indirectly) js engine in which tests are executed</simpara>
</listitem>
<listitem>
<simpara>executes test library logic</simpara>
</listitem>
<listitem>
<simpara>is responsible for some tests execution aspects (e.g. test isolation)</simpara>
</listitem>
<listitem>
<simpara>deals with some execution errors (e.g. no callback from async test, infinite loop in test)</simpara>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Test Library</emphasis></term>
<listitem>
<itemizedlist>
<listitem>
<simpara>provides test api that user can use in his project</simpara>
</listitem>
<listitem>
<simpara>coordinates scheduling and test code execution (e.g. order of tests, execution of setups / teardowns)</simpara>
</listitem>
<listitem>
<simpara>creates test results</simpara>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
<simpara>Below picture and listings depicts the components of the Test Runner in the IDE:</simpara>
<figure xml:id="fig:test_runner_components">
<title>Test Runner Components</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/09_testsupport/fig/test_runner_components.png" width="75%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>test runner components</phrase></textobject>
</mediaobject>
</figure>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara><emphasis>Test Delegate</emphasis></simpara>
</entry>
<entry>
<itemizedlist>
<listitem>
<simpara>After the test discovery it starts and stops the test session via the Test Facade.</simpara>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<simpara><emphasis>Test Facade</emphasis></simpara>
</entry>
<entry>
<itemizedlist>
<listitem>
<simpara>Ensures that an embedded HTTP server is running to receive messages from the Test Execution Environment. Registers a test session into the IDE side via the Test Finite State Machine Registry and triggers the actual test running at Test Execution Environment.</simpara>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<simpara><emphasis>HTTP Server</emphasis></simpara>
</entry>
<entry>
<itemizedlist>
<listitem>
<simpara>HTTP server is listening for HTTP requests from the Test Execution Environment via its RESTful API.</simpara>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<simpara><emphasis>Resource Router Servlet</emphasis></simpara>
</entry>
<entry>
<itemizedlist>
<listitem>
<simpara>This servlet is deployed into the servlet container of the HTTP Server. The servlet percepts the HTTP requests from the Test Execution Environment and delegates the request body to the corresponding REST Endpoint Logic.</simpara>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<simpara><emphasis>REST Endpoint Logic</emphasis></simpara>
</entry>
<entry>
<itemizedlist>
<listitem>
<simpara>Parses the HTTP request bodies, creates special events and sends them to all subscribers via the Test Event Bus.</simpara>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<simpara><emphasis>Test Event Bus</emphasis></simpara>
</entry>
<entry>
<itemizedlist>
<listitem>
<simpara>This component is used to asynchronously deliver messages between the main test runner components in a decoupled fashion.</simpara>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<simpara><emphasis>Test Finite State Machine Registry</emphasis></simpara>
</entry>
<entry>
<itemizedlist>
<listitem>
<simpara>This registry is used to cache test sessions represented as test trees and Test Finite State Machines. Percepts all messages initially sent by the Test Execution Environment and delegates them to the corresponding subscribers.</simpara>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<simpara><emphasis>Test Finite State Machine</emphasis></simpara>
</entry>
<entry>
<itemizedlist>
<listitem>
<simpara>Ensures the lifecycle of a test session. Handles timeouts duo to possible communication errors between the HTTP server and the Test Execution Environment.</simpara>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<simpara><emphasis>Test Tree Registry</emphasis></simpara>
</entry>
<entry>
<itemizedlist>
<listitem>
<simpara>Registry to handle the state of a test session. Responsible for updating a test tree associated with a test session with the received test results.</simpara>
</listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>
<simpara><emphasis>Test UI</emphasis></simpara>
</entry>
<entry>
<itemizedlist>
<listitem>
<simpara>This UI component provides feedback about the running test session to the end-user.</simpara>
</listitem>
</itemizedlist>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<section xml:id="sec:N4JS_Mangelhaft_support" role="language-n4js">
<title>N4JS Mangelhaft support</title>
<figure xml:id="fig:xUnitSupportDesign" role="center">
<title>xUnit Support Design</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/09_testsupport/fig/xUnitSupportDesign.png" width="75%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>xUnitSupportDesign</phrase></textobject>
</mediaobject>
</figure>
<simpara>In this section and subsections we specify N4IDE support for testing with Mangelhaft.</simpara>
<simpara>Mangelhaft is N4JS <emphasis>Test Library</emphasis>. It is focused more on a xUnit tests than other forms of testing (BDD, Acceptance Testing, Functional UI Testing).</simpara>
<simpara>The following test scenarios are supported on different <emphasis>Test Execution Environment</emphasis>s:</simpara>
<table xml:id="tab:Test_Scenarios" frame="all" rowsep="1" colsep="1">
<title>Test Scenarios</title>
<tgroup cols="4">
<colspec colname="col_1" colwidth="25*"/>
<colspec colname="col_2" colwidth="25*"/>
<colspec colname="col_3" colwidth="25*"/>
<colspec colname="col_4" colwidth="25*"/>
<thead>
<row>
<entry align="center" valign="top">Test</entry>
<entry align="center" valign="top">Node</entry>
<entry align="center" valign="top">Browser</entry>
<entry align="center" valign="top">Wrapper</entry>
</row>
</thead>
<tbody>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">Plain</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>yes</literal></simpara></entry>
<entry align="center" valign="top"><simpara><literal>yes</literal></simpara></entry>
<entry align="center" valign="top"></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">DOM</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="center" valign="top"><simpara><literal>yes</literal></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">non-interactive UI</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="center" valign="top"></entry>
<entry align="center" valign="top"></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">interactive UI (iUI)</emphasis></simpara></entry>
<entry align="center" valign="top"></entry>
<entry align="center" valign="top"></entry>
<entry align="center" valign="top"></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">(non UI) Server</emphasis></simpara></entry>
<entry align="center" valign="top"></entry>
<entry align="center" valign="top"></entry>
<entry align="center" valign="top"></entry>
</row>
<row>
<entry align="left" valign="top"><simpara><emphasis role="strong">iUI Server</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>-</literal></simpara></entry>
<entry align="center" valign="top"></entry>
<entry align="center" valign="top"></entry>
</row>
</tbody>
</tgroup>
</table>
<section xml:id="sec:Asynchronous_Tests">
<title>Asynchronous Tests, Test Isolation and Timeouts</title>
<simpara>A special problem about JavaScript tests is to control asynchronous tests and non-terminating tests.</simpara>
<simpara>Performance and test isolation are conflicting goals: a perfect isolation would mean to run every tests by a separate JavaScript engine, which is not performant. For that reason, all tests are run by the same JS-engine in general. A test has to notify the test runner when it has been finished (successfully or with failure). If it does not finish in a defined time (timeout), <emphasis>Test Execution Environment</emphasis> or <emphasis>Manglehaft</emphasis> needs to handle that (e.g. restart node vm in which code is executed)&#8230;&#8203;</simpara>
<simpara>Main concerns with running test in parallel on js side are:</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>Timeouts Mangelhaft is supposed to track test timeout. If tests are running in fake parallel mode achieved by cooperative multitasking, then one test running eats up time for other test. This can cause tests to timeout when running in parallel, while succeed when running in sequential mode.</simpara>
</listitem>
<listitem>
<simpara>Mutability on client. Tests running in parallel can affect each other by mutating global state in which they operate. When they run in sequential mode this can happen too, but it is much less likely to.</simpara>
</listitem>
<listitem>
<simpara>Mutable state on the server. Tests running on the same session/login are prone to affecting each other through server interaction (and or mutating data on the server).</simpara>
</listitem>
</orderedlist>
</section>
<section xml:id="sec:Supported_xUnit_API">
<title>Supported xUnit API</title>
<simpara>xUnit API is user facing API for defining tests. It allows test developer to define tests and configure some test execution aspects. N4IDE (via <emphasis>Test Runner</emphasis> extension) supports defined API by :</simpara>
<itemizedlist>
<listitem>
<simpara>gathering information via AST analysis and reflection</simpara>
</listitem>
<listitem>
<simpara>presenting user available actions, based on gathered information</simpara>
</listitem>
<listitem>
<simpara>gathering user input and configurations for test execution</simpara>
</listitem>
<listitem>
<simpara>generating proper data for test infrastructure, based on user actions</simpara>
</listitem>
</itemizedlist>
<section xml:id="sec:Test_Group">
<title>Test Group</title>
<simpara>A test group is a logical collection of tests. It is created by grouping <literal>N4ClassDeclarations</literal> that contain test methods or test methods directly (see <link linkend="sec:Test_Method">Test Method</link>). Those classes or individual methods can be assigned to a <emphasis>Group</emphasis> by annotating them with <literal>@Group</literal> annotation. This annotation takes non empty list of strings as parameter. Passed strings are used as category name (which is like its id).</simpara>
<programlisting language="xtext" linenumbering="unnumbered">Annotation:
'@Group'
(' $group+=$STRING ')?
AnnotatedElement
;
AnnnotatedElement:
N4JSClassDeclaration | N4JSMethodDeclaration
;</programlisting>
<simpara><literal>@Group</literal> properties</simpara>
<itemizedlist>
<listitem>
<simpara>name &#8594; <literal>Group</literal></simpara>
</listitem>
<listitem>
<simpara>targets &#8594; N4Method, N4Class</simpara>
</listitem>
<listitem>
<simpara>retention policy &#8594; RUNTIME</simpara>
</listitem>
<listitem>
<simpara>transitive &#8594; YES</simpara>
</listitem>
<listitem>
<simpara>repeatable &#8594; YES</simpara>
</listitem>
<listitem>
<simpara>arguments &#8594; <emphasis>String</emphasis>s</simpara>
</listitem>
<listitem>
<simpara>arguments are optional &#8594; NO</simpara>
</listitem>
</itemizedlist>
</section>
<section xml:id="sec:Test_Method">
<title>Test Method</title>
<simpara><emphasis>Test Method</emphasis> marks procedure that has to be executed by <emphasis>Test Library</emphasis>.</simpara>
<programlisting language="xtext" linenumbering="unnumbered">Annotation:
'@Test'
AnnotatedElement
;
AnnnotatedElement:
N4JSMethodDeclaration
;</programlisting>
<simpara><literal>@Test</literal> properties</simpara>
<itemizedlist>
<listitem>
<simpara>name &#8594; <literal>Test</literal></simpara>
</listitem>
<listitem>
<simpara>targets &#8594; N4Method</simpara>
</listitem>
<listitem>
<simpara>retention policy &#8594; RUNTIME</simpara>
</listitem>
<listitem>
<simpara>transitive &#8594; NO</simpara>
</listitem>
<listitem>
<simpara>repeatable &#8594; NO</simpara>
</listitem>
<listitem>
<simpara>arguments &#8594; none</simpara>
</listitem>
</itemizedlist>
<simpara>Additional <emphasis>TestMethod</emphasis> constraints:</simpara>
<simpara>Test Method <anchor xml:id="cnst:Test_Method" xreflabel="[cnst:Test_Method]"/></simpara>
<itemizedlist>
<listitem>
<simpara>allowed only <literal>N4ClassDeclarations</literal> in project test fragment</simpara>
</listitem>
<listitem>
<simpara>method must be public</simpara>
</listitem>
<listitem>
<simpara>method takes no parameters</simpara>
</listitem>
<listitem>
<simpara>method return type is <literal>Promise?</literal></simpara>
</listitem>
<listitem>
<simpara>method must not be referenced by other owning class members or other classes (also no <emphasis>@override</emphasis>)</simpara>
</listitem>
</itemizedlist>
</section>
<section xml:id="sec:BeforeAll">
<title>BeforeAll Setup</title>
<simpara><literal>@BeforeAll</literal> marks method that will be executed once before <emphasis role="strong">all</emphasis> tests in a given test class will be executed.</simpara>
<programlisting language="xtext" linenumbering="unnumbered">Annotation:
'@BeforeAll'
AnnotatedElement
;
AnnnotatedElement:
N4JSMethodDeclaration
;</programlisting>
<simpara><literal>@BeforeAll</literal> properties</simpara>
<itemizedlist>
<listitem>
<simpara>name &#8594; <literal>BeforeAll</literal></simpara>
</listitem>
<listitem>
<simpara>targets &#8594; N4Method</simpara>
</listitem>
<listitem>
<simpara>retention policy &#8594; RUNTIME</simpara>
</listitem>
<listitem>
<simpara>transitive &#8594; NO</simpara>
</listitem>
<listitem>
<simpara>repeatable &#8594; NO</simpara>
</listitem>
<listitem>
<simpara>arguments &#8594; none</simpara>
</listitem>
</itemizedlist>
<simpara>The same constraints apply as for the test method, see <link linkend="cnst:Test_Method">Test Method Constraints</link>.</simpara>
</section>
<section xml:id="sec:Before_Setup">
<title>Before Setup</title>
<simpara><literal>@Before</literal> marks method that will be executed once before <emphasis role="strong">each</emphasis> tests in a given test class will be executed.</simpara>
<programlisting language="xtext" linenumbering="unnumbered">Annotation:
'@Before'
AnnotatedElement
;
AnnnotatedElement:
N4JSMethodDeclaration
;</programlisting>
<simpara><literal>@Before</literal> properties</simpara>
<itemizedlist>
<listitem>
<simpara>name &#8594; <literal>Before</literal></simpara>
</listitem>
<listitem>
<simpara>targets &#8594; N4Method</simpara>
</listitem>
<listitem>
<simpara>retention policy &#8594; RUNTIME</simpara>
</listitem>
<listitem>
<simpara>transitive &#8594; NO</simpara>
</listitem>
<listitem>
<simpara>repeatable &#8594; NO</simpara>
</listitem>
<listitem>
<simpara>arguments &#8594; none</simpara>
</listitem>
</itemizedlist>
<simpara>The same constraints apply as for the test method, see <link linkend="cnst:Test_Method">Test Method Constraints</link>.</simpara>
</section>
<section xml:id="sec:After_Teardown">
<title>After Teardown</title>
<simpara><literal>@After</literal> marks method that will be executed once after <emphasis role="strong">each</emphasis> tests in a given test class will be executed.</simpara>
<programlisting language="xtext" linenumbering="unnumbered">Annotation:
'@After'
AnnotatedElement
;
AnnnotatedElement:
N4JSMethodDeclaration
;</programlisting>
<simpara><literal>@After</literal> properties</simpara>
<itemizedlist>
<listitem>
<simpara>name &#8594; <literal>After</literal></simpara>
</listitem>
<listitem>
<simpara>targets &#8594; N4Method</simpara>
</listitem>
<listitem>
<simpara>retention policy &#8594; RUNTIME</simpara>
</listitem>
<listitem>
<simpara>transitive &#8594; NO</simpara>
</listitem>
<listitem>
<simpara>repeatable &#8594; NO</simpara>
</listitem>
<listitem>
<simpara>arguments &#8594; none</simpara>
</listitem>
</itemizedlist>
<simpara>The same constraints apply as for the test method, see <link linkend="cnst:Test_Method">Test Method Constraints</link>.</simpara>
</section>
<section xml:id="sec:AfterAll_Teardown">
<title>AfterAll Teardown</title>
<simpara><literal>@AfterAll</literal> marks method that will be executed once after <emphasis role="strong">all</emphasis> tests in a given test class will be executed.</simpara>
<programlisting language="xtext" linenumbering="unnumbered">Annotation:
'@After'
AnnotatedElement
;
AnnnotatedElement:
N4JSMethodDeclaration
;</programlisting>
<itemizedlist mark="Test Fixture][cnst:Test_Fixture">
<listitem>
<simpara>allowed only in class marked with <emphasis>@TestClass</emphasis></simpara>
</listitem>
<listitem>
<simpara>method must be public</simpara>
</listitem>
<listitem>
<simpara>method takes no parameters</simpara>
</listitem>
<listitem>
<simpara>method return type is <literal>void</literal></simpara>
</listitem>
<listitem>
<simpara>method must not be referenced by other owning class members</simpara>
</listitem>
</itemizedlist>
<simpara><literal>@AfterAll</literal> properties</simpara>
<itemizedlist>
<listitem>
<simpara>name &#8594; <literal>AfterAll</literal></simpara>
</listitem>
<listitem>
<simpara>targets &#8594; N4Method</simpara>
</listitem>
<listitem>
<simpara>retention policy &#8594; RUNTIME</simpara>
</listitem>
<listitem>
<simpara>transitive &#8594; NO</simpara>
</listitem>
<listitem>
<simpara>repeatable &#8594; NO</simpara>
</listitem>
<listitem>
<simpara>arguments &#8594; none</simpara>
</listitem>
</itemizedlist>
<simpara>The same constraints apply as for the test method, see <link linkend="cnst:Test_Method">Test Method Constraints</link>.</simpara>
</section>
<section xml:id="sec:Test_Ignore">
<title>Test Ignore</title>
<informaltable tabstyle="horizontal" frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colwidth="15*"/>
<colspec colwidth="85*"/>
<tbody valign="top">
<row>
<entry>
<simpara>name</simpara>
</entry>
<entry>
<simpara>@Ignore</simpara>
</entry>
</row>
<row>
<entry>
<simpara>targets</simpara>
</entry>
<entry>
<simpara>N4Method, N4Class</simpara>
</entry>
</row>
<row>
<entry>
<simpara>retention policy</simpara>
</entry>
<entry>
<simpara>RUNTIME</simpara>
</entry>
</row>
<row>
<entry>
<simpara>transitive</simpara>
</entry>
<entry>
<simpara>YES</simpara>
</entry>
</row>
<row>
<entry>
<simpara>repeatable</simpara>
</entry>
<entry>
<simpara>NO</simpara>
</entry>
</row>
<row>
<entry>
<simpara>arguments</simpara>
</entry>
<entry>
<simpara>String reason</simpara>
</entry>
</row>
<row>
<entry>
<simpara>arguments are optional</simpara>
</entry>
<entry>
<simpara>&#8594; Yes</simpara>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<simpara><emphasis>Test Ignore</emphasis> allows to mark tests that should be skipped during the test execution. That is the preferred way to temporarily disable tests without removing them (or commenting them out). Test developers may provide reason for skipping to make reason/intentions clearer.</simpara>
<simpara>This annotation is <emphasis>transitive</emphasis>, which means that: <emphasis>Test Method</emphasis> is considered as marked with <emphasis>Test Skip</emphasis></simpara>
<itemizedlist>
<listitem>
<simpara>explicitly when it is directly marked or</simpara>
</listitem>
<listitem>
<simpara>implicitly, when container of a <emphasis>Test Method</emphasis> is marked.</simpara>
</listitem>
</itemizedlist>
<simpara>If a class is marked as <literal>@Ignore</literal>, then all its contained test methods will be ignored.<?asciidoc-br?>
When <literal>@Ignore</literal> occurs at class level in a test class hierarchy chain, then the following rules are applied. Assume the following test classes:</simpara>
<programlisting language="n4js" linenumbering="unnumbered">export public class A {
@Test
public aTest(): void {
console.log('A#aTest');
}
}</programlisting>
<programlisting language="n4js" linenumbering="unnumbered">import { A } from "A"
@Ignore('Class B is ignored.')
export public class B extends A {
@Test
public b1Test(): void {
console.log('B#b1Test');
}
@Ignore("Method B#b2Test is ignored.")
@Test
public b2Test(): void {
console.log("B#b2Test");
}
}</programlisting>
<programlisting language="n4js" linenumbering="unnumbered">import { B } from "B"
export public class C extends B {
@Test
public cTest(): void {
console.log('C#cTest');
}
}</programlisting>
<itemizedlist>
<listitem>
<simpara>When module <emphasis>A</emphasis> is being tested, then it is obvious that all the test methods of <literal>A</literal> will be tested. No methods will be skipped at all.</simpara>
</listitem>
<listitem>
<simpara>When module <emphasis>B</emphasis> is being tested, then although the inherited members of class <literal>A</literal> will be included in the test tree, all methods, including the inherited ones (from class <literal>A</literal> from module <emphasis>A</emphasis>) will be skipped. Nothing will be tested.</simpara>
</listitem>
<listitem>
<simpara>When module <emphasis>C</emphasis> is being tested, then all inherited members from class <literal>B</literal> and class <literal>A</literal> will be collected an included in the test tree. The <literal>@Ignore</literal> annotation declared at class level at <literal>B</literal> will be ignored but the <literal>@Ignore</literal> at method level in class <literal>B</literal> will be considered. In a nutshell, the following methods will be executed:</simpara>
<itemizedlist>
<listitem>
<simpara><literal>A#aTest</literal></simpara>
</listitem>
<listitem>
<simpara><literal>B#b1Test</literal></simpara>
</listitem>
<listitem>
<simpara><literal>C#cTest</literal></simpara>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<simpara>The above described behavior is identical to the behavior of <emphasis>JUnit 4</emphasis> with respect to the <literal>@Ignore</literal> annotation handling in case of test class inheritance.</simpara>
</section>
<section xml:id="sec:Timeout">
<title>Timeout</title>
<simpara><emphasis>Timeout</emphasis> allows test developer to set custom timeout when executing given test code. This can be used to set timeout for both <emphasis>Test Method</emphasis>s or <emphasis>Test Fixtures</emphasis></simpara>
<programlisting language="xtext" linenumbering="unnumbered">Annotation:
'@Timeout'
($timoeout+=$INT)?
AnnotatedElement
;
AnnnotatedElement:
N4JSClassDeclaration | N4JSMethodDeclaration
;</programlisting>
<simpara><literal>@Timeout</literal> properties</simpara>
<itemizedlist>
<listitem>
<simpara>name &#8594; <literal>Timeout</literal></simpara>
</listitem>
<listitem>
<simpara>targets &#8594; N4Method, N4Class</simpara>
</listitem>
<listitem>
<simpara>retention policy &#8594; RUNTIME</simpara>
</listitem>
<listitem>
<simpara>transitive &#8594; YES</simpara>
</listitem>
<listitem>
<simpara>repeatable &#8594; NO</simpara>
</listitem>
<listitem>
<simpara>arguments &#8594; Number</simpara>
</listitem>
<listitem>
<simpara>arguments are optional &#8594; NO</simpara>
</listitem>
</itemizedlist>
</section>
<section xml:id="sec:Description">
<title>Description</title>
<simpara><emphasis>Description</emphasis> allows test developer provide string describing given test or test class that <emphasis>can</emphasis> be used in IDE test view or in the test report.</simpara>
<programlisting language="xtext" linenumbering="unnumbered">Annotation:
'@Description'
($desc+=$STRING)?
AnnotatedElement
;
AnnnotatedElement:
N4JSClassDeclaration | N4JSMethodDeclaration
;</programlisting>
<simpara><literal>@Description</literal> properties</simpara>
<itemizedlist>
<listitem>
<simpara>name &#8594; <literal>Description</literal></simpara>
</listitem>
<listitem>
<simpara>targets &#8594; N4Method, N4Class</simpara>
</listitem>
<listitem>
<simpara>retention policy &#8594; RUNTIME</simpara>
</listitem>
<listitem>
<simpara>transitive &#8594; YES</simpara>
</listitem>
<listitem>
<simpara>arguments &#8594; String</simpara>
</listitem>
<listitem>
<simpara>arguments are optional &#8594; NO</simpara>
</listitem>
</itemizedlist>
</section>
</section>
</section>
<section xml:id="sec:Test_Reporting">
<title>Test Reporting</title>
<simpara><emphasis>Test Runtime Environment</emphasis> communicates with <emphasis>Test Runner</emphasis> over HTTP. Defined communication is based on protocol used between lupenrein and old ide. It is used to send the information about test execution progress from the <emphasis>Test Runtime</emphasis> to <emphasis>Test Runner</emphasis>. Information send by this protocol is not equivalent to test results. <emphasis>Test Runner</emphasis> interprets progress it receives and based on gathered information it generates test results. Under specific conditions <emphasis>Test Runner</emphasis> may change reported test status PASS to test result FAILED and put this information to the test report e.g. when timeout happens (see note on timeouts below).</simpara>
<figure xml:id="fig:sm_TestListener" role="center">
<title>TestListener</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/09_testsupport/fig/sm_TestListener.png" width="25%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>sm TestListener</phrase></textobject>
</mediaobject>
</figure>
<simpara><link linkend="fig:sm_TestListener">Test Listener</link> shows Communication flow expected by the <emphasis>Test Runner</emphasis>. When the <emphasis>Test Runner</emphasis> is started first it waits for <emphasis>Start Session</emphasis> message. Next <emphasis>Test Tree</emphasis> message is expected. This describes list of all tests that are expected to be executed. For all tests in the list <emphasis>Test Runner</emphasis> expects <emphasis>Test Start</emphasis> and <emphasis>Test End</emphasis> message to be received. <emphasis>End Session</emphasis> is expected to be last message in the test session. <emphasis>Ping</emphasis> message can be send multiple times in between other messages to manage synchronization issues between <emphasis>Test Runner</emphasis> and <emphasis>Test Runtime</emphasis> (see below).</simpara>
<simpara>Since all communication is asynchronous, IDE <emphasis>Test Runner</emphasis> must assume some timeout values that will define standard wait time during communication:</simpara>
<itemizedlist>
<listitem>
<simpara>Initial 90s timeout to wait for the <emphasis>Start Session</emphasis> message. It may be fixed or adjusted to given environment (local/remote) and project (library/application).</simpara>
</listitem>
<listitem>
<simpara>Default timeout between all other test messages is 10 seconds. <emphasis>Test Runtime</emphasis> may notify IDE <emphasis>Test Runner</emphasis> that it should wait longer with <emphasis>Ping</emphasis> <emphasis>test message</emphasis>. This is one time thing, as soon as another command is received the default timeout will have to be reused again.</simpara>
</listitem>
</itemizedlist>
<simpara>Do to the asynchronous nature of the tests, status updates can be given out of order by the Test Runtime Environment. The only sure thing is that all tests begin with <emphasis>SessionStart</emphasis> and ends with a <emphasis>SessionEnd</emphasis>. Furthermore a <emphasis>TestStart</emphasis> will be send before the <emphasis>TestEnd</emphasis> for a particular test.</simpara>
<section xml:id="sec:Test_Messages">
<title>Test Messages</title>
<simpara>IDE <emphasis>Test Runner</emphasis> will be waiting for specific messages from <emphasis>Test Runtime</emphasis>. We assume that communication will be done over HTTP protocol. <emphasis>Test Execution Environement</emphasis> should be configured by the <emphasis>Test Runner</emphasis> in a way that <emphasis>Test Runtime</emphasis> knows address where it has to send messages (see
<link linkend="sec:Test_Runtime_Configuration">Test Runtime Configuration</link>). <emphasis>Test Runner</emphasis> exposes RESTful API allowing him to receive messages. Below we define parts of that api that enable specific messages to be communicated.</simpara>
<simpara>When defining <emphasis>Test Message</emphasis>s we assume following model of tests:</simpara>
<programlisting language="n4js" linenumbering="unnumbered">TestTree {
ID sessionId,
Array&lt;TestSuite&gt;? testSuites
}
TestSuite {
string name,
Array&lt;TestCase&gt;? testCases,
Array&lt;TestSuite&gt;? children
}
TestCase {
ID id,
string className,
string origin,
string name,
string displayName,
TestResult? result
}
TestResult {
TestStatus teststatus,
number elapsed,
string? expected,
string? actual,
string? message,
array&lt;string&gt;? trace
}
enum TestStatus {
PASSED, SKIPPED, FAILED, ERROR
}
ID {
string value
}</programlisting>
<section xml:id="_test-case-ids">
<title>Test Case IDs</title>
<simpara>The ID of a test case in the following specifications is referred to as <literal>testID</literal>.
This ID is of the following structure:</simpara>
<screen>testID: fqn '#' methodName</screen>
<simpara>When used as part of the URL the testID is percent-escaped as defined in <link xl:href="https://tools.ietf.org/html/rfc3986#section-2.1">RFC3986 Section 2.1</link>. This is necessarry to circumvent the fact that the N4JS FQN delimiter <literal>/</literal> is a reserved character in URLs and cannot be used in its original form.</simpara>
</section>
<section xml:id="sec:Start_Session">
<title>Start Session</title>
<simpara>Signals start of the test session. When user triggers test execution, configures <emphasis>IDETestRunnerCtrl</emphasis>, afterwards IDE <emphasis>Listener</emphasis> waits for this message from <emphasis>TestRunner</emphasis>.</simpara>
<programlisting language="json" linenumbering="unnumbered">StartSession :
uri : /n4js/testing/sessions/{sessionID}/start
method : POST
contentType : application/vnd.n4js.start_session_req.tm+json
accept: application/json
responses:
200:
400:</programlisting>
<simpara>Start session request object MIME type <emphasis>application/vnd.n4js.start_session_req.tm+json</emphasis>:</simpara>
<programlisting language="json" linenumbering="unnumbered">{
map&lt;string, string&gt;? properties
}</programlisting>
</section>
<section xml:id="sec:Ping_Session">
<title>Ping Session</title>
<simpara>Signals that test runner is still busy doing things, and will report later to the listener.</simpara>
<programlisting language="json" linenumbering="unnumbered">PingSession :
uri : /n4js/testing/sessions/{sessionID}/ping
method : POST
contentType : application/vnd.n4js.ping_session_req.tm+json
accept: application/json
responses:
200:
400:</programlisting>
<simpara>Ping session request object MIME type <emphasis>application/vnd.n4js.ping_session_req.tm+json</emphasis>:</simpara>
<programlisting language="json" linenumbering="unnumbered">{
number timeout,
string? comment
}</programlisting>
</section>
<section xml:id="sec:End_Session">
<title>End Session</title>
<simpara>Signals end of test session Notifies IDE <emphasis>Listener</emphasis> that session is finished and no further related <emphasis>TestMessage</emphasis>s are expected. IDE, can stop listening and proceed with its own tasks (e.g. create summary test report ).</simpara>
<programlisting language="json" linenumbering="unnumbered">EndSession :
uri : /n4js/testing/sessions/{sessionID}/end
method : POST
responses:
200:
400:</programlisting>
</section>
<section xml:id="sec:Start_Test">
<title>Start Test</title>
<simpara>Signals that a test run has started. Updates the state of the test reported with the <emphasis>tree</emphasis> .</simpara>
<programlisting language="json" linenumbering="unnumbered">StartTest :
uri : /n4js/testing/sessions/{sessionID}/tests/{testID}/start
method : POST
contentType : application/vnd.n4js.start_test_req.tm+json
accept: application/json
responses:
200:
contentType : application/vnd.n4js.start_test_res.tm+json
400:</programlisting>
<simpara>Start test request object MIME type <emphasis>application/vnd.n4js.start_test_req.tm+json</emphasis>:</simpara>
<programlisting language="json" linenumbering="unnumbered">{
number timeout,
map&lt;string, string&gt;? properties
}</programlisting>
<simpara>Start test response object MIME type <emphasis>application/vnd.n4js.start_test_res.tm+json</emphasis>:</simpara>
<programlisting language="json" linenumbering="unnumbered">{
links : [
{
rel: "ping test",
uri: "/n4js/testing/sessions/{sessionID}/tests/{testID}/ping"
},
{
rel: "end test",
uri: "/n4js/testing/sessions/{sessionID}/tests/{testID}/end"
}
]
}</programlisting>
</section>
<section xml:id="sec:End_Test">
<title>End Test</title>
<simpara>Signals that a test run has ended. Updates the state of the test reported with the <emphasis>tree</emphasis> .</simpara>
<programlisting language="json" linenumbering="unnumbered">EndTest :
uri : /n4js/testing/sessions/{sessionID}/tests/{testID}/end
method : POST
contentType : application/vnd.n4js.end_test_req.tm+json
accept: application/json
responses:
200:
400:</programlisting>
<simpara>End test request object MIME type <emphasis>application/vnd.n4js.end_test_req.tm+json</emphasis>:</simpara>
<programlisting language="json" linenumbering="unnumbered">{
TestResult result
}</programlisting>
</section>
<section xml:id="sec:Ping_Test">
<title>Ping Test</title>
<simpara>Notifies IDE that <emphasis>TestRunner</emphasis> is doing something (e.g. test setup/teardown code, long running test). Without this notification IDE might interpret long pause in received messages as timeout, <emphasis>TestRunner</emphasis> crash or other issues (in consequence it might terminate whole test execution environment).</simpara>
<programlisting language="json" linenumbering="unnumbered">PingTest :
uri : /n4js/testing/sessions/{sessionID}/tests/{testID}/ping
method : POST
contentType : application/vnd.n4js.ping_test_req.tm+json
accept: application/json
responses:
200:
400:</programlisting>
<simpara>Ping test request object MIME type <emphasis>application/vnd.n4js.ping_test_req.tm+json</emphasis>:</simpara>
<programlisting language="json" linenumbering="unnumbered">{
number timeout,
string? comment
}</programlisting>
</section>
<section xml:id="sec:Test_Catalog">
<title>Test Catalog</title>
<simpara>Assembles and returns with the test catalog representing all the tests available in the underlying <emphasis>IN4JSCore</emphasis> specific workspace. The content of the test catalog is calculated dynamically. The test catalog calculation depends on the current built state of the workspace. If the workspace was cleaned and not built yet, then a test catalog containing zero test suites (and test cases) will be provided as a response. If the workspace is built and in consistent state, then a catalog containing all test cases will be sent as the response body. The provided test catalog format complies to the Mangelhaft reporters.</simpara>
<programlisting language="json" linenumbering="unnumbered">TestCatalog :
uri : /n4js/testing/sessions/testcatalog
method : GET
contentType : application/vnd.n4js.assemble_test_catalog_req.tm+json
accept: application/json
responses:
200:
400:</programlisting>
<simpara>Below listings represents an example of the test catalog format:</simpara>
<programlisting language="json" linenumbering="unnumbered">{
"endpoint": "http://localhost:9415",
"sessionId": "fc3a425c-b675-47d7-8602-8877111cf909",
"testDescriptors": [
{
"origin": "SysProjectA-0.0.1",
"fqn": "T/T",
"testMethods": [
"t"
]
},
{
"origin": "TestProjectA-0.0.1",
"fqn": "A/A",
"testMethods": [
"a"
]
},
{
"origin": "TestProjectA-0.0.1",
"fqn": "B/B",
"testMethods": [
"b1",
"b2"
]
},
{
"origin": "TestProjectB-0.0.1",
"fqn": "CSub1/CSub1",
"testMethods": [
"c1",
"c2"
]
},
{
"origin": "TestProjectB-0.0.1",
"fqn": "CSub2/CSub2",
"testMethods": [
"c1",
"c2",
"c3"
]
}
]
}</programlisting>
</section>
<section xml:id="sec:Test_Session_Example">
<title>Test Session Example</title>
<simpara>Below example demonstrates what are the expected HTTP requests and JSON structures for a simple test group.</simpara>
<programlisting language="n4js" linenumbering="unnumbered">class A {
@Test
public void foo() {}
@Test
@Ignore
public void bar() {}
}
class B {
@Test
public void baz() {}
}
class C {
@Test
public void qux() {}
}</programlisting>
<programlisting language="json" linenumbering="unnumbered">Request method: POST
Request path: http://localhost:9415/n4js/testing/sessions/19f47a37-c1d1-4cb7-a514-1e131f26ab13/start/
Headers: Accept=*/*
Content-Type=application/vnd.n4js.start_session_req.tm+json; charset=ISO-8859-1</programlisting>
<programlisting language="json" linenumbering="unnumbered">Request method: POST
Request path: http://localhost:9415/n4js/testing/sessions/19f47a37-c1d1-4cb7-a514-1e131f26ab13/tests/Test%2FC%23qux/start/
Headers: Accept=*/*
Content-Type=application/vnd.n4js.start_test_req.tm+json; charset=ISO-8859-1
Body:
{
"timeout": 1000
}
Request method: POST
Request path: http://localhost:9415/n4js/testing/sessions/19f47a37-c1d1-4cb7-a514-1e131f26ab13/tests/Test%2FB%23baz/start/
Headers: Accept=*/*
Content-Type=application/vnd.n4js.start_test_req.tm+json; charset=ISO-8859-1
Body:
{
"timeout": 1000
}
Request method: POST
Request path: http://localhost:9415/n4js/testing/sessions/19f47a37-c1d1-4cb7-a514-1e131f26ab13/tests/Test%2FA%23bar/start/
Headers: Accept=*/*
Content-Type=application/vnd.n4js.start_test_req.tm+json; charset=ISO-8859-1
Body:
{
"timeout": 1000
}
Request method: POST
Request path: http://localhost:9415/n4js/testing/sessions/19f47a37-c1d1-4cb7-a514-1e131f26ab13/tests/Test%2FA%23foo/start/
Headers: Accept=*/*
Content-Type=application/vnd.n4js.start_test_req.tm+json; charset=ISO-8859-1
Body:
{
"timeout": 1000
}</programlisting>
<programlisting language="json" linenumbering="unnumbered">Request method: POST
Request path: http://localhost:9415/n4js/testing/sessions/19f47a37-c1d1-4cb7-a514-1e131f26ab13/tests/Test%2FA%23bar/ping
Headers: Accept=*/*
Content-Type=application/vnd.n4js.ping_test_req.tm+json; charset=ISO-8859-1
Body:
{
"timeout": 1000
}
Request method: POST
Request path: http://localhost:9415/n4js/testing/sessions/19f47a37-c1d1-4cb7-a514-1e131f26ab13/tests/Test%2FC%23qux/ping/
Headers: Accept=*/*
Content-Type=application/vnd.n4js.ping_test_req.tm+json; charset=ISO-8859-1
Body:
{
"timeout": 2000
}</programlisting>
<programlisting language="json" linenumbering="unnumbered">Request method: POST
Request path: http://localhost:9415/n4js/testing/sessions/19f47a37-c1d1-4cb7-a514-1e131f26ab13/tests/Test%2FB%23baz/end/
Headers: Accept=*/*
Content-Type=application/vnd.n4js.end_test_req.tm+json; charset=ISO-8859-1
Body:
{
"message": "Some optional message.",
"trace": [
"trace_element_1",
"trace_element_2",
"trace_element_3"
],
"expected": "1",
"testStatus": "FAILED",
"elapsedTime": 100,
"actual": "2"
}
Request method: POST
Request path: http://localhost:9415/n4js/testing/sessions/19f47a37-c1d1-4cb7-a514-1e131f26ab13/tests/Test%2FC%23qux/end/
Headers: Accept=*/*
Content-Type=application/vnd.n4js.end_test_req.tm+json; charset=ISO-8859-1
Body:
{
"message": "Some failure message.",
"trace": [
"trace_element_1",
"trace_element_2",
"trace_element_3"
],
"expected": "4",
"testStatus": "FAILED",
"elapsedTime": 50,
"actual": "3"
}
Request method: POST
Request path: http://localhost:9415/n4js/testing/sessions/19f47a37-c1d1-4cb7-a514-1e131f26ab13/tests/Test%2F%23foo/end/
Headers: Accept=*/*
Content-Type=application/vnd.n4js.end_test_req.tm+json; charset=ISO-8859-1
Body:
{
"expected": "2",
"testStatus": "PASSED",
"elapsedTime": 60,
"actual": "power of 2 for 2"
}
Request method: POST
Request path: http://localhost:9415/n4js/testing/sessions/19f47a37-c1d1-4cb7-a514-1e131f26ab13/tests/Test%2FA%23bar/end/
Headers: Accept=*/*
Content-Type=application/vnd.n4js.end_test_req.tm+json; charset=ISO-8859-1
Body:
{
"testStatus": "SKIPPED",
"elapsedTime": 0,
}</programlisting>
<programlisting language="json" linenumbering="unnumbered">Request method: POST
Request path: http://localhost:9415/n4js/testing/sessions/19f47a37-c1d1-4cb7-a514-1e131f26ab13/end/
Headers: Accept=*/*
Content-Type=application/vnd.n4js.end_session_req.tm+json; charset=ISO-8859-1</programlisting>
</section>
</section>
<section xml:id="sec:Test_Runtime_Configuration">
<title>Test Runtime Configuration</title>
<simpara><emphasis>Test Runner</emphasis> must gather relevant information and send it to <emphasis>Test Environment</emphasis> to allow proper test execution:</simpara>
<itemizedlist>
<listitem>
<simpara>gathering user input and test options</simpara>
</listitem>
<listitem>
<simpara>gathering information about user project test code</simpara>
</listitem>
<listitem>
<simpara>maintaining proper name mappings (e.g. if project is minimized test names/references must be mapped correctly)</simpara>
</listitem>
</itemizedlist>
</section>
<section xml:id="sec:Test_Plan">
<title>Test Plan</title>
<simpara><emphasis>Test Runner</emphasis> uses N4IDE infrastructure to obtain information about test fragment of the user project. Based on that information and user input in UI (e.g. triggering test execution on whole project) IDE can determine <emphasis>Test Method</emphasis>s that should be executed. Such test list or <emphasis>Test Plan</emphasis> is send to <emphasis>Test Environment</emphasis> and is expected to be executed by a <emphasis>Test Library</emphasis>.</simpara>
<programlisting language="json" linenumbering="unnumbered">TestPlan {
Array&lt;TestProcedure&gt; procedures
}
TestProcedure {
string functionName,
string functionType,
string functionContainer,
string containerModule
}</programlisting>
</section>
<section xml:id="sec:Test_Environment_Configuration">
<title>Test Environment Configuration</title>
<simpara>Additionally <emphasis>Test Runner</emphasis> sends to <emphasis>Test Environment</emphasis> other configuration options:</simpara>
<itemizedlist>
<listitem>
<simpara><emphasis>Test Runner</emphasis> test communication protocol base url (<emphasis>baseURL</emphasis>)</simpara>
</listitem>
</itemizedlist>
</section>
<section xml:id="sec:Test_Environment_Configuration_Example">
<title>Test Environment Configuration Example</title>
<simpara>For example assuming that user selects <emphasis>ProjectX</emphasis> to test that contains only one test class in <emphasis>src/test/n4js/core</emphasis> path like:</simpara>
<programlisting language="n4js" linenumbering="unnumbered">class MyTestClass{
@BeforeAll
public void someOneTimeSetup(){ /* setup code */}
@Test
public void testA(){ /* some test code*/ }
@Test
public void testB(){ /* some test code*/ }
@Test
public void testC(){ /* some test code*/ }
@After
public void afterCleanup(){ /* setup code */}
}</programlisting>
<simpara>Configuration sent for <emphasis>Test Execution Environment</emphasis> would look like:</simpara>
<programlisting language="json" linenumbering="unnumbered">{
"baseURL" : "http://localhost:1234/",
"testPlan":
[
{
"functionName": "someOneTimeSetup",
"functionType": "@BeforeAll",
"functionContainer": "MyTestClass",
"containerModule": "test/n4js/core/MyTestClass",
},
{
"functionName": "testA",
"functionType": "@Test",
"functionContainer": "MyTestClassA",
"containerModule": "test/n4js/core/MyTestClassA",
},
{
"functionName": "afterCleanup",
"functionType": "@After",
"functionContainer": "MyTestClassA",
"containerModule": "test/n4js/core/MyTestClassA",
},
{
"functionName": "testB",
"functionType": "@Test",
"functionContainer": "MyTestClassA",
"containerModule": "test/n4js/core/MyTestClassA",
},
{
"functionName": "afterCleanup",
"functionType": "@After",
"functionContainer": "MyTestClassA",
"containerModule": "test/n4js/core/MyTestClassA",
},
{
"functionName": "testC",
"functionType": "@Test",
"functionContainer": "MyTestClassA",
"containerModule": "test/n4js/core/MyTestClassA",
},
{
"functionName": "afterCleanup",
"functionType": "@After",
"functionContainer": "MyTestClassA",
"containerModule": "test/n4js/core/MyTestClassA",
}
]
}</programlisting>
</section>
</section>
</chapter>
<chapter xml:id="_help-system">
<title>Help System</title>
<section xml:id="sec:Built_In_Help">
<title>Built-In Help</title>
</section>
<section xml:id="sec:Context_Sensitive_Help">
<title>Context Sensitive Help</title>
</section>
<section xml:id="sec:Cheat_Sheets">
<title>Cheat Sheets</title>
</section>
<section xml:id="sec:JSDoc">
<title>JSDoc</title>
</section>
<section xml:id="sec:Hovering">
<title>Hovering</title>
<simpara>Hovering over an element (such as type, field, method, function or variable declaration) in the N4JS editor will cause a tooltip appear containing information about the underlying element. Currently this information is the type (could be the inferred type as well), the name and the keyword (such as class, variable, field) of the actual element. By default the tooltip does not grab the focus from the currently active workbench window and will automatically disappear after the focus is lost from the element. One can grab the focus for the tooltip by clicking into the tooltip area or pressing <keycap>F2</keycap> function key.</simpara>
<section xml:id="sec:Show_Type_Information_of_Selection">
<title>Show Type Information of Selection</title>
<simpara>In some cases, during the development process, one would like to know what is the actual or even the inferred type of an N4JS expression. To use this functionality one can select the desired expression in the editor and invoke the ’Show Type Information’ command via the <keycap>Cmd</keycap> + <keycap>Option</keycap>+ <keycap>I</keycap> ( <keycap>Ctrl</keycap> + <keycap>Alt</keycap>+ <keycap>I</keycap> Windows/Linux) from the keyboard. This case a popup window will be raised containing the type information of the actual selection.</simpara>
</section>
</section>
<section xml:id="sec:Example_Projects_and_Files">
<title>Example Projects and Files</title>
</section>
</chapter>
<chapter xml:id="_bug-management">
<title>Bug Management</title>
<warning>
<simpara>Parts of this document may be outdated.</simpara>
</warning>
<section xml:id="sec:Built_In_Xpect_Support">
<title>Built-In Xpect Support</title>
<simpara>N4IDE contains built-in support for <link xl:href="http://www.xpect-tests.org/">xpect</link> based tests. The purpose of those is to create tests for N4IDE support for user code, not the user code itself. Users can create <emphasis>fileName.n4js.xt</emphasis> to write their test for a given N4IDE functionality. Those files can be executed (via context menu, run configurations, etc.) to verify user expectations.</simpara>
<section xml:id="sec:Report_View">
<title>Report View</title>
<simpara>When executing xpect tests, users can view the results in a special view available in the IDE: <keycap>Window</keycap> &#8594; <keycap>Show View</keycap> &#8594; <keycap>Other</keycap> &#8594; <keycap>Test Views</keycap> &#8594; <keycap>Xpect View</keycap>.</simpara>
<figure xml:id="fig:test_view" role="center">
<title>Test View</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/11_bugmanagement/fig/testView.png" width="75%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>testView</phrase></textobject>
</mediaobject>
</figure>
<simpara>This view allows user to generate bug report (see <link linkend="sec:Generate_Bug_Report">Generating Bug Reports</link>).</simpara>
<simpara>In case of failing tests, users can see additional information (e.g. a stacktrace), or call a comparison view.</simpara>
<figure xml:id="fig:comparison" role="center">
<title>Comparison</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/11_bugmanagement/fig/comparison.png" width="75%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>comparison</phrase></textobject>
</mediaobject>
</figure>
</section>
<section xml:id="sec:Generate_Bug_Report">
<title>Generate Bug Report</title>
<simpara>Generating bug reports can be done when there is some <literal>.n4js.xt</literal> file with all passing expectations, and at least one of them marked with <emphasis>FIXME</emphasis>. In this case icon of the executed test suite changes and via context menu user can call generate bug report option. When it is done, user can see contents of the bug generated in the console view. This output is prepared for out JIRA ticketing system.</simpara>
<figure xml:id="fig:bug_report" role="center">
<title>Bug Report</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/11_bugmanagement/fig/bugReport.png" width="75%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>bugReport</phrase></textobject>
</mediaobject>
</figure>
<simpara>There is also possibility to generate bug report via file selection and context menu. In this case xpect test is not executed, only bug contents are generated.</simpara>
<figure xml:id="fig:bug" role="center">
<title>Submited Bug</title>
<mediaobject>
<imageobject>
<imagedata fileref="chapters/11_bugmanagement/fig/bug.png" width="50%" scalefit="1" align="center"/>
</imageobject>
<textobject><phrase>bug</phrase></textobject>
</mediaobject>
</figure>
</section>
<section xml:id="sec:Supported_Xpect_Tests">
<title>Supported Xpect Tests</title>
<simpara>Xpect methods are special form of comments inside <emphasis>.xt</emphasis> files. General syntax for declaring usage of such method is <emphasis>XPECT</emphasis> marker followed by <emphasis>XpectMethodName</emphasis> and parameters for that method, all placed in comment. This can have three forms:</simpara>
<itemizedlist>
<listitem>
<simpara>Single line comment (see the first comment in the listing below), Notice <emphasis role="strong"><literal>&#8594;</literal></emphasis> separating the method name and its parameters.</simpara>
</listitem>
<listitem>
<simpara>Multi line comment with one method invocation, notice <emphasis role="strong"><literal>-</literal></emphasis> separating the method name and its parameters</simpara>
</listitem>
<listitem>
<simpara>Multi line comment with multiple method invocations, simmilar to one above, but each line of method parameters indicates separate method invocation</simpara>
<programlisting language="n4js" linenumbering="unnumbered">//XPECT errors --&gt; "Couldn't resolve reference to IdentifiableElement 'consoleX'." at "consoleX"
consoleX.log(10);
/*XPECT errors ---
"Couldn't resolve reference to IdentifiableElement 'logY'." at "logY"
---*/
console.logY(10);
/*XPECT errors ---
"Couldn't resolve reference to IdentifiableElement 'log'." at "log"
"Couldn't resolve reference to IdentifiableElement 'ref'." at "ref"
--- */
log(ref);</programlisting>
</listitem>
</itemizedlist>
<section xml:id="sec:XPECT_N4JS_Errors">
<title>Errors, Warnings, Infos, Issues</title>
<simpara><emphasis>Errors</emphasis>, <emphasis>Warnings</emphasis>, <emphasis>Infos</emphasis> are xpect methods that allow to capture marker of given severity. Additionally <emphasis>Issues</emphasis> allows to allow markers of all above severities.</simpara>
<simpara>All of those methods can be used single invocations or as mutline invocations.</simpara>
<programlisting language="n4js" linenumbering="unnumbered">//XPECT errors --&gt; "Couldn't resolve reference to IdentifiableElement 'x'." at "x"
console.log(x)
//XPECT warnings --&gt; "Variable names should start with lower case letter." at "String"
var String = "some string"</programlisting>
</section>
<section xml:id="sec:XPECT_N4JS_Noerrors">
<title>Noerrors</title>
<simpara>No errors allows to catch (and suppress) marker of any severity (<emphasis>error</emphasis>, <emphasis>warning</emphasis>, <emphasis>info</emphasis>).</simpara>
<programlisting language="n4js" linenumbering="unnumbered">//XPECT noerrors --&gt; "window object should be recognized"
console.log(window)</programlisting>
</section>
<section xml:id="sec:XPECT_N4JS_Output">
<title>Output, OutputRegex</title>
<simpara>Output methods are special in sense that they are not intended to be used on single element of the script, but they apply to the whole script.</simpara>
<programlisting language="n4js" linenumbering="unnumbered">/* XPECT output ---
&lt;==
stdout:
hello world
stderr:
==&gt;
--- */
console.log("hello world")</programlisting>
<simpara>Second method accepts regex expressions. This allows to deal with troublesome output (e.g. dates)</simpara>
<programlisting language="n4js" linenumbering="unnumbered">/* XPECT outputRegex ---
&lt;==
stdout:
[^\n]*
stderr:
==&gt;
--- */
console.log(new Date())</programlisting>
<programlisting language="n4js" linenumbering="unnumbered">/* XPECT outputRegex ---
&lt;==
stdout:
hello world
stderr:
[^\n]+
throw ' cruel world'
\^
cruel world
==&gt;
--- */
console.log("hello world")
throw ' cruel world'</programlisting>
</section>
<section xml:id="sec:XPECT_N4JS_Type_Of">
<title>Type Of</title>
<simpara>Xpect type methods allow test type inference, both for inferred type or expected type.</simpara>
<programlisting language="n4js" linenumbering="unnumbered">//XPECT type of 'probablySomeString' --&gt; string
var probablySomeString = "some string";
var union{string,number} u;
// XPECT expectedType at 'null' --&gt; {function(number?):string}
u.toString = null</programlisting>
</section>
<section xml:id="sec:XPECT_Advanced_Methods">
<title>Advanced methods</title>
<simpara>There are also other methods provided, that allow to test quick fixes and content assist. Their parameters syntax is more complicated. Additionally they actively modify contents of the editor, or even close it if needed. Their usage exceeds scope of this document.</simpara>
</section>
</section>
</section>
</chapter>
<chapter xml:id="_cli">
<title>CLI</title>
<warning>
<simpara>Parts of this document may be outdated.</simpara>
</warning>
<section xml:id="sec:Headless_Compiler" role="language-bash">
<title>Headless Compiler</title>
<simpara>The headless compiler is provided as a separate tool, coming as a single jar file <literal>n4jsc.jar</literal>. It is to be invoked via</simpara>
<programlisting language="bash" linenumbering="unnumbered">java -jar n4jsc.jar</programlisting>
<simpara>Simply invoking the headless compiler with no further arguments will print out a description of command line options.</simpara>
<simpara>The headless compiler works in three major modes (given as arguments to the switch <literal>-bt</literal>):</simpara>
<itemizedlist>
<listitem>
<simpara>compilation of single files (<literal>-bt singlefile</literal>, <emphasis>default</emphasis>),</simpara>
</listitem>
<listitem>
<simpara>compilation of given projects (<literal>-bt projects</literal>) or</simpara>
</listitem>
<listitem>
<simpara>compilation of all projects (<literal>-bt allprojects</literal>)</simpara>
</listitem>
</itemizedlist>
<simpara>The command-line invocation usually has the form of</simpara>
<programlisting language="bash" linenumbering="unnumbered">java -jar n4jsc.jar ^$[options]$^ file1 file2 ...</programlisting>
<simpara>Standard compiler <emphasis>options</emphasis>:</simpara>
<variablelist>
<varlistentry>
<term><literal>--buildType</literal> , <literal>-bt</literal> <emphasis>mode</emphasis></term>
<listitem>
<simpara>With <emphasis>mode</emphasis> as exactly one of</simpara>
<variablelist>
<varlistentry>
<term>singlefile</term>
<listitem>
<simpara>only the source files given by <emphasis>file1</emphasis>, <emphasis>file2</emphasis>, &#8230;&#8203; are compiled.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>projects</term>
<listitem>
<simpara><emphasis>file1</emphasis>, <emphasis>file2</emphasis>, &#8230;&#8203; denote projects (folders containing a <literal>manifest.n4mf</literal>). These projects will be compiled.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>allprojects</term>
<listitem>
<simpara>All project found under the project-root(s) are compiled. There should be no <emphasis>file&#8230;&#8203;</emphasis> given.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>dontcompile</term>
<listitem>
<simpara>Nothing will be compiled. There should be no <emphasis>file&#8230;&#8203;</emphasis> given. (This is the default if no <literal>-t</literal> option is given).</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--projectlocations</literal> (<literal>-pl</literal>) <literal>path</literal></term>
<listitem>
<simpara><anchor xml:id="opt-projectlocations" xreflabel="[opt-projectlocations]"/> provide folder(s) to search for projects. If not set, the base folder of the running JVM will be taken as the location. Multiple folders are separated by the systems path-separator (’<literal>:</literal>’ on Mac / Unix and ’<literal>;</literal>’ on Windows). Only direct subfolders will be queried for projects. A subfolder is assumed to be a N4JS-project if it contains a <literal>manifest.n4mf</literal> file. All found projects are taken into consideration for dependency-resolution. Example on Linux:<?asciidoc-br?>
<literal>-pl  /rootA/: /rootB:/some/absolute/path/to/projects</literal>.</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>Advanced compiler options (optional):</simpara>
<variablelist>
<varlistentry>
<term><literal>--notests</literal></term>
<listitem>
<simpara>turn off compilation of code in test-folders. Can not be combined with <literal>–testonly</literal></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--testonly</literal></term>
<listitem>
<simpara>only compile test code. Externals and sources will not be compiled. Can not be combined with <literal>–notests</literal></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--keepCompiling</literal></term>
<listitem>
<simpara>try to compile even if some errors occur.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--preference</literal> <emphasis>file</emphasis></term>
<listitem>
<simpara>uses <emphasis>file</emphasis> as there internal preferences-store similar to the preferences internally stored by the N4IDE.</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>Additional command line options (optional):</simpara>
<variablelist>
<varlistentry>
<term><literal>--help</literal> , <literal>-h</literal> </term>
<listitem>
<simpara>prints out help to the console and exits.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--verbose</literal> , <literal>-v</literal></term>
<listitem>
<simpara>verbose output during build</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--debug</literal> </term>
<listitem>
<simpara>before executing, summarises the information of the current setup like resolved pathnames and other information, carries on with normal workflow and prints additional status information about loading and unloading projects and processing each resource.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--log</literal></term>
<listitem>
<simpara>write a log file <literal>n4jsc.log</literal> to the base folder. (Change filename with <literal>–logfile filename</literal>)</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="sec:Headless_Dependencies" role="language-bash">
<title>Headless Dependnecies</title>
<simpara>Compiler can manage dependencies of the processed projects:</simpara>
<variablelist>
<varlistentry>
<term><literal>--installMissingDependencies</literal> , <literal>-imd</literal> </term>
<listitem>
<simpara>alnalyzes available projects and installs missing dependencies</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--targetPlatformInstallLocation</literal> , <literal>-tl</literal></term>
<listitem>
<simpara>location to which dependencies will be installed, if not provided temporal location will be used</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--npmrcRootLocation</literal></term>
<listitem>
<simpara>location of the <emphasis>.npmrc</emphasis> file to be used in <emphasis>npm</emphasis> invocations</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="sec:Headless_Execution" role="language-bash">
<title>Headless Execution</title>
<simpara>For headless compiling, running and testing of N4JS code a general command line tool is provided. Many parameters of the different use cases are shared. Although you can combine the use cases each of them is described in its own section. This section is about running compiled code.</simpara>
<simpara>For compiling refer to <link linkend="sec:Headless_Compiler">Headless Compiler</link> for executing tests refer to <link linkend="_test_support">Tests</link>.</simpara>
<section xml:id="sec:Cleaning_Headlessly">
<title>Cleaning Headlessly</title>
<simpara>It is possible to use the headless compiler to clean projects by using the following option</simpara>
<variablelist>
<varlistentry>
<term><literal>--clean</literal> (<literal>-c</literal>)</term>
<listitem>
<simpara>When this option is used. The headless compiler only cleans projects without compilation. Moreover, the use of this option requires that the option <literal>-t</literal> must be specified and must be either <literal>-t projects</literal> or <literal>-t allprojects</literal>.</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>For instance, <literal>n4jsc --clean -t allprojects -pl path/to/project</literal> or <literal>n4jsc --clean -t projects project1 project2</literal> are valid use while <literal>n4jsc --clean -t singlefile file1 file2</literal> is invalid.
After the calling the command with <literal>--clean (</literal>-c`), the output folders of the specified projects (e.g. <literal>src-gen</literal> folders) are cleaned.</simpara>
</section>
<section xml:id="sec:Running_Headlessly">
<title>Running Headlessly</title>
<simpara>Running code from the command line requires basically three different pieces of information:</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>The locations where projects, libraries and environments can be found must be given.</simpara>
</listitem>
<listitem>
<simpara>The starting point of execution must be given by pointing to a module.</simpara>
</listitem>
<listitem>
<simpara>Since there are multiple different project types, an adequate Runner has to be selected.</simpara>
</listitem>
</orderedlist>
<simpara>The follwing command line switches are used to provide this information:</simpara>
<variablelist>
<varlistentry>
<term><literal>--projectlocations</literal> (<literal>-pl</literal>) <literal>path</literal></term>
<listitem>
<simpara>path of locations to search for projects (c.f. <link linkend="sec:Headless_Compiler">Headless Compiler</link> ,<link linkend="opt-projectlocations">Project Locations</link>)</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--runWith</literal> (<literal>-rw</literal>) <literal>VAL</literal></term>
<listitem>
<simpara>denotes the runner-id (as listed with --list-runners) or at least the last segment of it</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--run</literal> (<literal>-r</literal>) <literal>FILE</literal></term>
<listitem>
<simpara>source-module to run. Note you should point to the full location of the source file (*.n4js). The runner is <emphasis>responsible to determine the compiled file</emphasis>. It is not sufficient to give a project-relative path, it always needs to be a full path to the source file.</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>It is possible to compile and run with a single CLI line. Compilation always precedes the execution. It the compilation fails the runner will not be started.</simpara>
<simpara>To ease the usage of different runners it is allowed to provide the last segment(s) of the runner-id in a case-insensitive way, e.g. one can use the runner with id <literal>org.eclipse.n4js.runner.nodejs.NODEJS</literal> as follows:</simpara>
<programlisting language="bash" linenumbering="unnumbered">.. --runWith org.eclipse.n4js.runner.nodejs.NODEJS ..</programlisting>
<simpara>or in short</simpara>
<programlisting language="bash" linenumbering="unnumbered">.. --rw NODEJS ..</programlisting>
<simpara>or even lower-cased with</simpara>
<programlisting language="bash" linenumbering="unnumbered">.. --rw nodejs ..</programlisting>
<simpara>Assume having a common workspace location ’wsp’ with a project ’P1’ containing the module ’A’. The following line shows how to run this code:</simpara>
<programlisting language="bash" linenumbering="unnumbered">java -jar n4jsc.jar -pl wsp -rw nodejs -r wsp/P1/src/A.n4js</programlisting>
</section>
<section xml:id="sec:Information_about_running_headlessly">
<title>Information about running headlessly</title>
<simpara>Available runner-ids can be actively queried:</simpara>
<variablelist>
<varlistentry>
<term><literal>--listRunners</literal> (<literal>-lr</literal>)</term>
<listitem>
<simpara>prints out a list of all available command-line runners</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="sec:Testing_Headlessly">
<title>Testing Headlessly</title>
<simpara>Testing code from the command line requires basically three different pieces of information:</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>The locations where projects, libraries and environments can be found must be given.</simpara>
</listitem>
<listitem>
<simpara>The starting point of test execution must be given by pointing to what is supposed to be tested (single file / whole project)/</simpara>
</listitem>
<listitem>
<simpara>Since there are multiple different project types, an adequate Tester has to be selected.</simpara>
</listitem>
</orderedlist>
<simpara>The follwing command line switches are used to provide this information:</simpara>
<variablelist>
<varlistentry>
<term><literal>--projectlocations</literal> (<literal>-pl</literal>) <literal>path</literal></term>
<listitem>
<simpara>path of locations to search for projects (c.f. <link linkend="sec:Headless_Compiler">Headless Compiler</link> ,<link linkend="opt-projectlocations">Project Locations</link>)</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--testWith</literal> (<literal>-tw</literal>) <literal>VAL</literal></term>
<listitem>
<simpara>denotes the tester-id (as listed with --list-testers) or at least the last segment of it</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>--test</literal> (<literal>-t</literal>) <literal>FILE</literal></term>
<listitem>
<simpara>source-module to run. Note you should point to the full location of the project with tests, specific folder inside project with tests or the test source file (*.n4js). It is not sufficient to give a project-relative path, it always needs to be a full path to the source file.</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>It is possible to compile and run with a single CLI line. Compilation always precedes the execution. It the compilation fails the tester will not be started.</simpara>
<simpara>To ease the usage of different testers it is allowed to provide the last segment(s) of the tester-id in a case-insensitive way, e.g. one can use the runner with id <literal>org.eclipse.n4js.tester.nodejs.NODEJS_MANGELHAFT</literal> as follows:</simpara>
<programlisting language="bash" linenumbering="unnumbered">.. --runWith org.eclipse.n4js.tester.nodejs.NODEJS_MANGELHAFT ..</programlisting>
<simpara>or in short</simpara>
<programlisting language="bash" linenumbering="unnumbered">.. --rw NODEJS_MANGELHAFT ..</programlisting>
<simpara>or even lower-cased with</simpara>
<programlisting language="bash" linenumbering="unnumbered">.. --rw nodejs_mangelhaft ..</programlisting>
<simpara>Assume having a common workspace location ’wsp’ with a project ’P1’ containing the module ’TestA’. The following line shows how to execute this test code:</simpara>
<programlisting language="bash" linenumbering="unnumbered">java -jar n4jsc.jar -pl wsp -tw nodejs_mangelhaft -t wsp/P1/src/TestA.n4js</programlisting>
</section>
<section xml:id="sec:Information_about_testing_headlessly">
<title>Information about testing headlessly</title>
<simpara>Available tester-ids can be actively queried:</simpara>
<variablelist>
<varlistentry>
<term><literal>--listTesters</literal> (<literal>-lt</literal>)</term>
<listitem>
<simpara>prints out a list of all available command-line testers</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
<section xml:id="_testresults">
<title>TestResults</title>
<simpara>TODO</simpara>
<simpara><?asciidoc-pagebreak?></simpara>
</section>
</section>
</chapter>
<appendix xml:id="sec:License">
<title>License</title>
<simpara>This specification and the accompanying materials is made available
under the terms of the Eclipse Public License v1.0 which accompanies
this distribution, and is available at <link xl:href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</link></simpara>
<bridgehead xml:id="_eclipse-public-license-v-1-0" renderas="sect2">Eclipse Public License - v 1.0</bridgehead>
<simpara>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
PUBLIC LICENSE (<literal>AGREEMENT</literal>). ANY USE, REPRODUCTION OR DISTRIBUTION OF
THE PROGRAM CONSTITUTES RECIPIENT’S ACCEPTANCE OF THIS AGREEMENT.</simpara>
<bridgehead xml:id="_1-definitions" renderas="sect3">1. DEFINITIONS</bridgehead>
<variablelist>
<varlistentry>
<term><literal>Contribution</literal> means: </term>
<listitem>
<orderedlist numeration="arabic">
<listitem>
<simpara>in the case of the initial Contributor, the initial code and
documentation distributed under this Agreement, and</simpara>
</listitem>
<listitem>
<simpara>in the case of each subsequent Contributor:</simpara>
<orderedlist numeration="loweralpha">
<listitem>
<simpara>changes to the Program, and</simpara>
</listitem>
<listitem>
<simpara>additions to the Program;</simpara>
<simpara>where such changes and/or additions to the Program originate from and
are distributed by that particular Contributor. A Contribution
’originates’ from a Contributor if it was added to the Program by such
Contributor itself or anyone acting on such Contributor’s behalf.
Contributions do not include additions to the Program which:</simpara>
<orderedlist numeration="lowerroman">
<listitem>
<simpara>are separate modules of software distributed in conjunction with the Program
under their own license agreement, and</simpara>
</listitem>
<listitem>
<simpara>are not derivative works of the Program.</simpara>
</listitem>
</orderedlist>
</listitem>
</orderedlist>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>Contributor</literal></term>
<listitem>
<simpara>means any person or entity that distributes the Program.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>Licensed Patents</literal> </term>
<listitem>
<simpara>mean patent claims licensable by a Contributor
which are necessarily infringed by the use or sale of its Contribution
alone or when combined with the Program.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>Program</literal> </term>
<listitem>
<simpara>means the Contributions distributed in accordance with this
Agreement.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>Recipient</literal> </term>
<listitem>
<simpara>means anyone who receives the Program under this
Agreement, including all Contributors.</simpara>
</listitem>
</varlistentry>
</variablelist>
<bridgehead xml:id="_2-grant-of-rights" renderas="sect3">2. GRANT OF RIGHTS</bridgehead>
<orderedlist numeration="arabic">
<listitem>
<simpara>Subject to the terms of this Agreement, each Contributor hereby
grants Recipient a non-exclusive, worldwide, royalty-free copyright
license to reproduce, prepare derivative works of, publicly display,
publicly perform, distribute and sublicense the Contribution of such
Contributor, if any, and such derivative works, in source code and
object code form.</simpara>
</listitem>
<listitem>
<simpara>Subject to the terms of this Agreement, each Contributor hereby
grants Recipient a non-exclusive, worldwide, royalty-free patent license
under Licensed Patents to make, use, sell, offer to sell, import and
otherwise transfer the Contribution of such Contributor, if any, in
source code and object code form. This patent license shall apply to the
combination of the Contribution and the Program if, at the time the
Contribution is added by the Contributor, such addition of the
Contribution causes such combination to be covered by the Licensed
Patents. The patent license shall not apply to any other combinations
which include the Contribution. No hardware per se is licensed
hereunder.</simpara>
</listitem>
<listitem>
<simpara>Recipient understands that although each Contributor grants the
licenses to its Contributions set forth herein, no assurances are
provided by any Contributor that the Program does not infringe the
patent or other intellectual property rights of any other entity. Each
Contributor disclaims any liability to Recipient for claims brought by
any other entity based on infringement of intellectual property rights
or otherwise. As a condition to exercising the rights and licenses
granted hereunder, each Recipient hereby assumes sole responsibility to
secure any other intellectual property rights needed, if any. For
example, if a third party patent license is required to allow Recipient
to distribute the Program, it is Recipient’s responsibility to acquire
that license before distributing the Program.</simpara>
</listitem>
<listitem>
<simpara>Each Contributor represents that to its knowledge it has sufficient
copyright rights in its Contribution, if any, to grant the copyright
license set forth in this Agreement.</simpara>
</listitem>
</orderedlist>
<bridgehead xml:id="_3-requirements" renderas="sect3">3. REQUIREMENTS</bridgehead>
<simpara>A Contributor may choose to distribute the Program in object code form
under its own license agreement, provided that:</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>it complies with the terms and conditions of this Agreement; and</simpara>
</listitem>
<listitem>
<simpara>its license agreement:</simpara>
<orderedlist numeration="loweralpha">
<listitem>
<simpara>effectively disclaims on behalf of all Contributors all warranties
and conditions, express and implied, including warranties or conditions
of title and non-infringement, and implied warranties or conditions of
merchantability and fitness for a particular purpose;</simpara>
</listitem>
<listitem>
<simpara>effectively excludes on behalf of all Contributors all liability for
damages, including direct, indirect, special, incidental and
consequential damages, such as lost profits;</simpara>
</listitem>
<listitem>
<simpara>states that any provisions which differ from this Agreement are
offered by that Contributor alone and not by any other party; and</simpara>
</listitem>
<listitem>
<simpara>states that source code for the Program is available from such
Contributor, and informs licensees how to obtain it in a reasonable
manner on or through a medium customarily used for software exchange.</simpara>
</listitem>
</orderedlist>
</listitem>
</orderedlist>
<simpara>When the Program is made available in source code form:</simpara>
<orderedlist numeration="arabic">
<listitem>
<simpara>it must be made available under this Agreement; and</simpara>
</listitem>
<listitem>
<simpara>a copy of this Agreement must be included with each copy of the
Program.</simpara>
</listitem>
</orderedlist>
<simpara>Contributors may not remove or alter any copyright notices contained
within the Program.</simpara>
<simpara>Each Contributor must identify itself as the originator of its
Contribution, if any, in a manner that reasonably allows subsequent
Recipients to identify the originator of the Contribution.</simpara>
<bridgehead xml:id="_4-commercial-distribution" renderas="sect3">4. COMMERCIAL DISTRIBUTION</bridgehead>
<simpara>Commercial distributors of software may accept certain responsibilities
with respect to end users, business partners and the like. While this
license is intended to facilitate the commercial use of the Program, the
Contributor who includes the Program in a commercial product offering
should do so in a manner which does not create potential liability for
other Contributors. Therefore, if a Contributor includes the Program in
a commercial product offering, such Contributor (<literal>Commercial
Contributor</literal>) hereby agrees to defend and indemnify every other
Contributor (<literal>Indemnified Contributor</literal>) against any losses, damages
and costs (collectively <literal>Losses</literal>) arising from claims, lawsuits and
other legal actions brought by a third party against the Indemnified
Contributor to the extent caused by the acts or omissions of such
Commercial Contributor in connection with its distribution of the
Program in a commercial product offering. The obligations in this
section do not apply to any claims or Losses relating to any actual or
alleged intellectual property infringement. In order to qualify, an
Indemnified Contributor must: a) promptly notify the Commercial
Contributor in writing of such claim, and b) allow the Commercial
Contributor to control, and cooperate with the Commercial Contributor
in, the defense and any related settlement negotiations. The Indemnified
Contributor may participate in any such claim at its own expense.</simpara>
<simpara>For example, a Contributor might include the Program in a commercial
product offering, Product X. That Contributor is then a Commercial
Contributor. If that Commercial Contributor then makes performance
claims, or offers warranties related to Product X, those performance
claims and warranties are such Commercial Contributor’s responsibility
alone. Under this section, the Commercial Contributor would have to
defend claims against the other Contributors related to those
performance claims and warranties, and if a court requires any other
Contributor to pay any damages as a result, the Commercial Contributor
must pay those damages.</simpara>
<bridgehead xml:id="_5-no-warranty" renderas="sect3">5. NO WARRANTY</bridgehead>
<simpara>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED
ON AN <literal>AS IS</literal> BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES
OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR
A PARTICULAR PURPOSE. Each Recipient is solely responsible for
determining the appropriateness of using and distributing the Program
and assumes all risks associated with its exercise of rights under this
Agreement , including but not limited to the risks and costs of program
errors, compliance with applicable laws, damage to or loss of data,
programs or equipment, and unavailability or interruption of operations.</simpara>
<bridgehead xml:id="_6-disclaimer-of-liability" renderas="sect3">6. DISCLAIMER OF LIABILITY</bridgehead>
<simpara>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</simpara>
<bridgehead xml:id="_7-general" renderas="sect3">7. GENERAL</bridgehead>
<simpara>If any provision of this Agreement is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of
the remainder of the terms of this Agreement, and without further action
by the parties hereto, such provision shall be reformed to the minimum
extent necessary to make such provision valid and enforceable.</simpara>
<simpara>If Recipient institutes patent litigation against any entity (including
a cross-claim or counterclaim in a lawsuit) alleging that the Program
itself (excluding combinations of the Program with other software or
hardware) infringes such Recipient’s patent(s), then such Recipient’s
rights granted under Section 2(b) shall terminate as of the date such
litigation is filed.</simpara>
<simpara>All Recipient’s rights under this Agreement shall terminate if it fails
to comply with any of the material terms or conditions of this Agreement
and does not cure such failure in a reasonable period of time after
becoming aware of such noncompliance. If all Recipient’s rights under
this Agreement terminate, Recipient agrees to cease use and distribution
of the Program as soon as reasonably practicable. However, Recipient’s
obligations under this Agreement and any licenses granted by Recipient
relating to the Program shall continue and survive.</simpara>
<simpara>Everyone is permitted to copy and distribute copies of this Agreement,
but in order to avoid inconsistency the Agreement is copyrighted and may
only be modified in the following manner. The Agreement Steward reserves
the right to publish new versions (including revisions) of this
Agreement from time to time. No one other than the Agreement Steward has
the right to modify this Agreement. The Eclipse Foundation is the
initial Agreement Steward. The Eclipse Foundation may assign the
responsibility to serve as the Agreement Steward to a suitable separate
entity. Each new version of the Agreement will be given a distinguishing
version number. The Program (including Contributions) may always be
distributed subject to the version of the Agreement under which it was
received. In addition, after a new version of the Agreement is
published, Contributor may elect to distribute the Program (including
its Contributions) under the new version. Except as expressly stated in
Sections 2(a) and 2(b) above, Recipient receives no rights or licenses
to the intellectual property of any Contributor under this Agreement,
whether expressly, by implication, estoppel or otherwise. All rights in
the Program not expressly granted under this Agreement are reserved.</simpara>
<simpara>This Agreement is governed by the laws of the State of New York and the
intellectual property laws of the United States of America. No party to
this Agreement will bring a legal action under this Agreement more than
one year after the cause of action arose. Each party waives its rights
to a jury trial in any resulting litigation.</simpara>
</appendix>
<appendix xml:id="sec:Acronyms">
<title>Acronyms</title>
<informaltable xml:id="AC" role="language-bash" frame="all" rowsep="1" colsep="1">
<tgroup cols="4">
<colspec colname="col_1" colwidth="8.3333*"/>
<colspec colname="col_2" colwidth="41.6666*"/>
<colspec colname="col_3" colwidth="8.3333*"/>
<colspec colname="col_4" colwidth="41.6668*"/>
<tbody>
<row>
<entry align="center" valign="top"><simpara><literal>CDep</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Compile-Time Dependency</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>RDep</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Run-Time Dependency</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>LDep</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Load-Time Dependency</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>IDep</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Initialization-Time Dependency</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>EDep</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Execution-Time Dependency</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>ANTLR</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">ANother Tool for Language Recognition</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>API</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Application Programming Interface</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>AST</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Abstract Syntax Tree</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>ASI</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Automatic Semicolon Insertion</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>BNF</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Backus-Naur Form</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>CLI</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Command Line Interface (including a headless compiler and runner.)</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>DI</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Dependency Injection</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>DIC</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">DI Component</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>DOM</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Document Object Model</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>DSL</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Domain Specific Language</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>EBNF</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Extended Backus-Naur Form</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>EMF</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Eclipse Modeling Framework <anchor xml:id="EMF" xreflabel="[EMF]"/></emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>FQN</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Fully Qualified Name</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>GLB</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Greatest Lower Bound, also known as <emphasis>infimum</emphasis></emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>GCST</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Greatest Common Sub Type, also known as <emphasis>meet</emphasis></emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>IDE</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Integrated Development Environment</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>IDL</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Interface Definition Language</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>LSP</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Liskov Substitution Principle [<link linkend="Martin96b">Martin96b</link>]</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>LUB</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Least Upper Bound, also known as <emphasis>supremum</emphasis></emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>LCST</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Least Common Super Type, also known as <emphasis>join</emphasis></emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>N4JS</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">N4JS for JavaScript</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>N4JSED</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">N4JS Environment Definition</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>N4JSIDE</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">N4JS Integrated Development Environment (Eclipse-based IDE for all N4JS related languages and projects)</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>VM</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Virtual Machine</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>XML</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Extensible Markup Language</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>XSLT / XSL</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">XSL Transformations</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>XSL</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Extensible Stylesheet Language</emphasis></simpara></entry>
</row>
<row>
<entry align="center" valign="top"><simpara><literal>WYSIWYG</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">What You See Is What You Get</emphasis></simpara></entry>
<entry align="center" valign="top"><simpara><literal>WLOG</literal></simpara></entry>
<entry align="left" valign="top"><simpara><emphasis role="strong">Without loss of generality</emphasis></simpara></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</appendix>
<appendix xml:id="_bibliography">
<title>Bibliography</title>
<simpara><anchor xml:id="N4JSSpec" xreflabel="[N4JSSpec]"/><emphasis>N4JS Language Specification</emphasis>. </simpara>
<simpara><anchor xml:id="Martin96b" xreflabel="[Martin96b]"/>Martin, Robert C. (1996). <emphasis>The Liskov Substitution Principle</emphasis>. Retrieved from <link xl:href="http://www.objectmentor.com/publications/lsp.pdf">http://www.objectmentor.com/publications/lsp.pdf</link></simpara>
</appendix>
</book>