Knowledge Base Article

> Knowledge Base > Rapise

Created By  inflectra.adam Thursday, December 4, 2014
Rapise has built-in code completion logic that lets it suggest the available list of functions for a specific object. However since JavaScript is fundamentally an un-typed language, for the code completion to work, there are some tips and tricks that you can use.

JavaScript is not a strongly-typed programmed language. One may define a variable as simple as:

     var p;     


In this example p is just a variable with undefined type. It may be used as number, string or object. So Rapise has no idea of how to deal with it. So if you type a dot after  p.” no code-completion window appears.

Rapise scans for variable definitions when one saves the .js source file. So if anything goes wrong then first thing is to save the file.

Another essential place to check when typing code is “Warnings” screen. It is updated when you save the file and if there are any syntax errors in the current source text warnings screen will be populated:


There are several ways of explaining variable type.

First, is static assignment. Suppose you specify some constant value when defining a variable:

     var p="some string";


In this case Rapise knows the type of p. So it would assist you when you type a dot “.” after p:

In some cases variable type is not clear from its definition or assignments is not static:

     var v1 = input;

      var v2;


To deal with such cases the code should be instrumented. For example, if we know that input is string and v2 will be used as number then we may explain it to Rapise by placing variable type using special comment: /**<var_type*/ right together with var definition. It should be placed right either between var keyword and variable name or right after an assignment operation (=), if any. I.e.:

     var v1 = /**string*/input;

      var /**number*/v2;


So we will have code completion properly informed:


Another common case is a function parameter. Once function is defined like that:

function my_func(patient_index, patient_name)




The type of parameters patient_index and patient_name are not known, but may be explained in a similar way:

function my_func(/**number*/patient_index, /**string*/patient_name)


So it becomes known to Rapise:


Code completion for variable names is useful when you have multiple variables or function parameters and need to type them quickly. In this case Alt+Space keyword combination will bring up a list of variables and functions starting with just typed keyword.

For example, here I pressed Alt+Space to show list of functions starting with just typed “find_” prefix:

And then I pressed it to find a variable for “pa” prefix:

How to force code completion

Code completion is activated when you press “Alt+Space” keyword combination or when you press dot “.” key right after variable with known type.


Selected files will be attached to any email sent on saving ticket.

file selected files selected  () Delete Selected

  • Created:
  • by:

Select files to upload

Or drag and drop files here

Uploading …
Upload More?
There was an error.
Try again?

Save to upload the selected file(s)

Article Info
  • Last Updated: 12/4/2014
  • Article ID: KB98
  • Views: 4624