public interface ICodeAssist
This interface is not intended to be implemented by clients.
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.Modifier and Type | Method and Description |
---|---|
void |
codeComplete(int offset,
CompletionRequestor requestor)
Performs code completion at the given offset position in this javaScript unit,
reporting results to the given completion requestor.
|
void |
codeComplete(int offset,
CompletionRequestor requestor,
WorkingCopyOwner owner)
Performs code completion at the given offset position in this javaScript unit,
reporting results to the given completion requestor.
|
IJavaScriptElement[] |
codeSelect(int offset,
int length)
Returns the JavaScript elements corresponding to the given selected text in this javaScript unit.
|
IJavaScriptElement[] |
codeSelect(int offset,
int length,
WorkingCopyOwner owner)
Returns the JavaScript elements corresponding to the given selected text in this javaScript unit.
|
void codeComplete(int offset, CompletionRequestor requestor) throws JavaScriptModelException
offset
is the 0-based index of the character, after which code assist is desired.
An offset
of -1 indicates to code assist at the beginning of this
javaScript unit.
offset
- the given offset positionrequestor
- the given completion requestorJavaScriptModelException
- if code assist could not be performed. Reasons include:java.lang.IllegalArgumentException
- if requestor
is null
void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner) throws JavaScriptModelException
offset
is the 0-based index of the character, after which code assist is desired.
An offset
of -1 indicates to code assist at the beginning of this
javaScript unit.
It considers types in the working copies with the given owner first. In other words,
the owner's working copies will take precedence over their original javaScript units
in the workspace.
Note that if a working copy is empty, it will be as if the original javaScript unit had been deleted.
offset
- the given offset positionrequestor
- the given completion requestorowner
- the owner of working copies that take precedence over their original javaScript unitsJavaScriptModelException
- if code assist could not be performed. Reasons include:java.lang.IllegalArgumentException
- if requestor
is null
IJavaScriptElement[] codeSelect(int offset, int length) throws JavaScriptModelException
offset
is the 0-based index of the first selected character.
The length
is the number of selected characters.
Note that if the length
is 0 and the offset
is inside an identifier
or the index just after an identifier then this identifier is considered as the selection.
offset
- the given offset positionlength
- the number of selected charactersJavaScriptModelException
- if code resolve could not be performed. Reasons include:
IJavaScriptElement[] codeSelect(int offset, int length, WorkingCopyOwner owner) throws JavaScriptModelException
offset
is the 0-based index of the first selected character.
The length
is the number of selected characters.
It considers types in the working copies with the given owner first. In other words,
the owner's working copies will take precedence over their original javaScript units
in the workspace.
Note that if the length
is 0 and the offset
is inside an identifier
or the index just after an identifier then this identifier is considered as the selection.
Note that if a working copy is empty, it will be as if the original javaScript unit had been deleted.
offset
- the given offset positionlength
- the number of selected charactersowner
- the owner of working copies that take precedence over their original javaScript unitsJavaScriptModelException
- if code resolve could not be performed. Reasons include:
Copyright (c) IBM Corp. and others 2000, 2016. All Rights Reserved.