# Content Assist

## Use of Content Assist

Content Assist is a mechanism within Eclipse that offers to insert code from a menu that is activated on a simple keyboard shortcut, `Ctrl+Space` by default. After pressing the shortcut, the following menu appears:

As can be seen above, the proposal to insert can be chosen from the window. There are different kind of proposals, the available proposals depends on the context. Right from the items in the menu a popup displays information like the code that will be inserted for the particular snippet that is selected from the menu. Pressing `Enter` will insert the proposal in the editor and allow you to further edit the text.

Some proposals support the additional replacement mode. It is activated by holding the `Ctrl` when selecting the proposal.

## R Element (Names)

#### Proposals from other projects

To get proposals for R elements of other R projects in the Eclipse workspace, you have to add that projects to the list of referenced projects. The list can be edited at the project property page "Project References" of the selected project. Note, that closed projects cannot contribute R elements to the "R search path".

#### Proposals from packages

To get proposals for R elements of an R package, you have to import the package to the R script file by

- Roxygen `@import` tags
- R commands `load` and `require`

in this file. The 'base' package is always imported. StatET searches for the package at first in the references projects (recursively). If the package is not found in the workspace, the content assistant tries to fetch the R elements of the package from the currently active R instance (R console).

### Argument Information

After inserting a function name with arguments, the cursor is set after the left parenthesis and the available arguments are shown in a small information hover.

It is possible to shown this information for known functions at any time by invoking the content assist directly after the opening parenthesis or a comma between two function arguments. Reinvoking the content assist shows the normal completions proposals.

## Templates

Template proposals allow inserting predefined source snippets.

#### Configuration of snippet templates

The content of the predefined snippets can be configured in Window > Preferences at R > Source Editors > R Templates (Open)

## Resource Paths

Inside string this type enables the completion of path names for filesystem resources.