org.eclipse.wst.jsdt.ui.text.java

## Interface IInvocationContext

    public interface IInvocationContext

Context information for quick fix and quick assist processors.

Note: this interface is not intended to be implemented.

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

### Method Summary

All Methods Instance Methods Abstract Methods
`JavaScriptUnit` `getASTRoot()` Returns an AST of the compilation unit, possibly only a partial AST focused on the selection offset (see `ASTParser.setFocalPosition(int)`).
`IJavaScriptUnit` `getCompilationUnit()`
`ASTNode` `getCoveredNode()` Convenience method to evaluate the AST node that is covered by the current selection.
`ASTNode` `getCoveringNode()` Convenience method to evaluate the AST node covering the current selection.
`int` `getSelectionLength()`
`int` `getSelectionOffset()`

### Method Detail

#### getCompilationUnit

    IJavaScriptUnit getCompilationUnit()

Returns:
  Returns the current compilation unit.

#### getSelectionOffset

    int getSelectionOffset()

Returns:
  Returns the offset of the current selection

#### getSelectionLength

    int getSelectionLength()

Returns:
  Returns the length of the current selection

#### getASTRoot

    JavaScriptUnit getASTRoot()

Returns an AST of the compilation unit, possibly only a partial AST focused on the selection offset (see `ASTParser.setFocalPosition(int)`). The returned AST is shared and therefore protected and cannot be modified. The client must check the AST API level and do nothing if they are given an AST they can't handle. (see `AST.apiLevel()`).

Returns:
  Returns the root of the AST corresponding to the current compilation unit.

#### getCoveringNode

    ASTNode getCoveringNode()

Convenience method to evaluate the AST node covering the current selection.

Returns:
  Returns the node that covers the location of the problem

#### getCoveredNode

    ASTNode getCoveredNode()

Convenience method to evaluate the AST node that is covered by the current selection.

Returns:
  Returns the node that is covered by the location of the problem