Date: Fri, 29 Mar 2024 13:57:46 +0000 (UTC)
Message-ID: <1976012828.11093.1711720666335@911f0a1bad02>
Subject: Exported From Confluence
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_Part_11092_1709438107.1711720666335"
------=_Part_11092_1709438107.1711720666335
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Location: file:///C:/exported.html
Servoy comes with support for Refactoring. Code refactoring for =
a selected item can be accessed by selecting Refactor from=
the Script Editor context menu.
=20
It is important to note that for refactoring to work comprehensively, th=
e code must be properly documented through JSDoc. Insufficient information =
will result in decreased usefulness of the refactoring functionality.
=
=20
The available Refactoring functions are described below.
=20
=20
- Rename =E2=80=93 Renames variables (global, form and l=
ocal [within functions]), functions and function parameters. The rename ref=
actor changes the name both for the declaration of the object to be renamed=
, as well as all references to the object.
=20
- Extract Local Variable =E2=80=93 Extracts the selected=
value within a function's source to a local variable (i.e., a variable ins=
ide a function declaration). All occurrences of the selected value within t=
he function's source are replaced by a reference to the new variable.
=20
- Change Method Signature -- Alters the signature of an =
existing method and updates all calls to the method to use the new signatur=
e. Newly introduced parameters can be given a default value, so all calls t=
o the method can call the method with the default value for the new paramet=
er.
=20
- Extract Method -- Creates a new function based on the =
selected code within a function's source and replaces the selected code wit=
h a call to the newly created function.
=
li>=20
- Introduce Parameter -- Takes a hard-coded value inside=
the source of a function and creates a new parameter for it, replacing the=
hard-coded value with the parameter and updating all calls to the method t=
o send the previously hard-coded value as value for the newly created param=
eter.
=20
- Inline -- Replaces a method call with the code of the =
called method.
=20
=20
When performing a refactoring operation, a window will appear, allowing =
users to specify the required information and preview all the changes that =
will be made in all the code (similar to the Compare window described in th=
e Compare and Replace section in Code Rewriting Tools ).
------=_Part_11092_1709438107.1711720666335--