public class AceCompletionSnippet extends AceCompletion
AceCompletionProvider
. This particular implementation
allows for tabstops to be defines post-sunstitution.
There are two different constructors, a simple constructor that trust the user to manually escape the snippet text, and
a constructor where the escaping and tokenization is managed.
Warning: this is an experimental feature of AceGWT. It is possible that the API will change in an incompatible way in future releases.
Constructor and Description |
---|
AceCompletionSnippet(String caption,
AceCompletionSnippetSegment[] snippetSegments,
String meta,
int score)
Creates a snippet type substitution.
|
AceCompletionSnippet(String caption,
String snippet,
int score,
String meta)
Creates a snippet type substitution.
|
public AceCompletionSnippet(String caption, AceCompletionSnippetSegment[] snippetSegments, String meta, int score)
caption
- The caption of the completion (this is the left aligned autocompletion name on the left side of items in the dropdown box. If only a single completion is available in a context, then the caption will not be seen.snippetSegments
- The segments that make up this snippet. None of these segments needs to be escaped, this will be handled automatically.meta
- "meta" means the category of the substitution (this appears right aligned on the dropdown list). This is freeform description and can contain anything but typically a very short category description (9 chars or less) such as "function" or "param" or "template".score
- The score is the value assigned to the autocompletion option. Scores with a higher value will appear closer to the top. Items with an identical score are sorted alphbetically by caption in the drop down.public AceCompletionSnippet(String caption, String snippet, int score, String meta)
NOTE :: This is the advanced version of the completion snippet, where escaping and tokenization must be done manually.
It is recommended to use the alternative AceCompletionSnippet(String, AceCompletionSnippetSegment[], String, int)
constructor for 99% of use-cases. This raw version is provided as a convenience.
caption
- The caption of the completion (this is the left aligned autocompletion name on the left side of items in the dropdown box. If only a single completion is available in a context, then the caption will not be seen.snippet
- the snippet text of the substitution, this should be in the format start-${0:snippetText}-after-${1:nexttabstop}-after. $ and backslash and rbrace should be escaped with a leading backslashmeta
- "meta" means the category of the substitution (this appears right aligned on the dropdown list). This is freeform description and can contain anything but typically a very short category description (9 chars or less) such as "function" or "param" or "template".score
- The score is the value assigned to the autocompletion option. Scores with a higher value will appear closer to the top. Items with an identical score are sorted alphbetically by caption in the drop down.Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.