org.eclipse.ease

## Interface ICompletionContext

All Known Implementing Classes:
  CompletionContext, JavaScriptCompletionContext, PythonCompletionContext

    public interface ICompletionContext

Interface for completion context. This context helps ICompletionProvider to simplify completion proposal calculation. Stores information about given input, filter for part of interest, and Source stack for part of interest.

### Nested Class Summary

Nested Classes
`static class` `ICompletionContext.Type`

### Method Summary

All Methods Instance Methods Abstract Methods
`String` `getCaller()` Get the caller method for string literals.
`String` `getFilter()`
`Map<Object,String>` `getIncludedResources()` Get a list of included resource.
`Collection<ModuleDefinition>` `getLoadedModules()` Get a list of loaded modules.
`int` `getOffset()`
`String` `getOriginalCode()`
`String` `getPackage()` Returns the package for PACKAGE types.
`int` `getParameterOffset()` Get the index of the parameter for string literals.
`String` `getProcessedCode()`
`Class<? extends Object>` `getReferredClazz()`
`Object` `getResource()` Get the base resource of the context.
`IScriptEngine` `getScriptEngine()` Get the running script engine.
`ScriptType` `getScriptType()`
`int` `getSelectionRange()`
`ICompletionContext.Type` `getType()`

### Method Detail

#### getOriginalCode

    String getOriginalCode()

#### getProcessedCode

    String getProcessedCode()

#### getFilter

    String getFilter()

#### getReferredClazz

    Class<? extends Object> getReferredClazz()

#### getResource

    Object getResource()

Get the base resource of the context. Typically holds a reference to the file open in an editor

Returns:
  base resource or `null`

#### getScriptEngine

    IScriptEngine getScriptEngine()

Get the running script engine. Only works for live engines like a shell.

Returns:
  script engine or `null`

#### getScriptType

    ScriptType getScriptType()

#### getLoadedModules

    Collection<ModuleDefinition> getLoadedModules()

Get a list of loaded modules.

Returns:
  loaded modules

#### getIncludedResources

    Map<Object,String> getIncludedResources()

Get a list of included resource. Returns a map of resource objects -> resource content.

Returns:
  map of included resources

#### getType

    ICompletionContext.Type getType()

#### getOffset

    int getOffset()

#### getSelectionRange

    int getSelectionRange()

#### getPackage

    String getPackage()

Returns the package for PACKAGE types.

Returns:
  package name

#### getCaller

    String getCaller()

Get the caller method for string literals. On STRING_LITERAL types this value denotes the calling method. The whole context of the caller is passed as a value. Eg. "new java.lang.String". May not return `null`.

Returns:
  calling method or empty string

#### getParameterOffset

    int getParameterOffset()

Get the index of the parameter for string literals. On STRING_LITERAL types this value indicates which parameter we are looking at: 0 for the first, 1 for the second, ...

Returns:
  parameter offset for string literals