ICompletionItem Interface
- public interface ICompletionItem
public String |
-
getCompletionText ()
- Get the text as we would insert it into the document.
|
public Range |
-
getCompletionTextInsertPosition ()
- Assuming the entire completion text has been inserted, including any
extra characters tacked on, where should the cursor be placed.
|
public ICompletionItem.IFormatRange [] |
-
getDisplayFormatRanges ()
- Returns an array of IFormatRange objects, which divide the display text
up into sub-strings that should be rendered with alternate fonts or
colors, or possibly even with images.
|
public String |
-
getDisplayText ()
- Returns a string containing the text this completion item should show
in a drop-down menu.
|
public boolean |
-
isChainingCompletion ()
- Returns true if the source info feature should be queried for
more completions immediately following this completion.
|
getCompletionText() Method
public String
getCompletionText()
Get the text as we would insert it into the document.
This should not include the trigger character (i.e. '.' in Java
or '<' in XML).
It may however include extra characters after the identifier, that
would make the insertion complete (such as "()" after a Java method).
getCompletionTextInsertPosition() Method
public Range
getCompletionTextInsertPosition()
Assuming the entire completion text has been inserted, including any
extra characters tacked on, where should the cursor be placed.
Return null for the default behavior setting the cursor at the end.
Return a range (may be a single position) if the cursor should be placed
before or inside the completion text. For example, between the "()"
characters added after a method in Java.
getDisplayFormatRanges() Method
public ICompletionItem.IFormatRange
[] getDisplayFormatRanges()
Returns an array of IFormatRange objects, which divide the display text
up into sub-strings that should be rendered with alternate fonts or
colors, or possibly even with images.
Return null to display the entire display text in the default font.
getDisplayText() Method
public String
getDisplayText()
Returns a string containing the text this completion item should show
in a drop-down menu. It may be identical to getCompletionText().
But it may optionally include a data type, a parameter list, or anything
else.
The string may also optionally use tabs for formatting. Using tabs,
the drop-down may define any number of virtual columns. The tab stops
move as follows:
- The first tab is right-aligned at the end of the first column.
- The second tab defines a second column, and left-aligns text.
- The third tab is right-aligned at the end of the second column.
- etc.
Text that is left-aligned on one line may overlap right-aligned text
on another line.
Thus, two completion items with the following display text:
public \t int \tgetWidth()
\t String \tdoInitialization()
would lay out as follows in the drop-down menu:
+L---------R-L------------------+
|public int getWidth() |
| String doInitialization() |
+-------------------------------+
where the L and R marks above show the tab stops.
isChainingCompletion() Method
public boolean isChainingCompletion()
Returns true if the source info feature should be queried for
more completions immediately following this completion.