trait SuggestionProvider extends AnyRef
The base trait of suggestion providers which supplies completion proposals in some text areas.
- Alphabetic
- By Inheritance
- SuggestionProvider
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract val context: Seq[String]
Which contexts is this suggestion provider enabled.
Which contexts is this suggestion provider enabled. Currently, available contexts are
"issues"
and"wiki"
. - abstract val id: String
The identifier of this suggestion provider.
The identifier of this suggestion provider. You must specify the unique identifier in the all suggestion providers.
- abstract val prefix: String
The trigger of this suggestion provider.
The trigger of this suggestion provider. When user types this character, the proposal list would be displayed. Also this is used as the prefix of the replaced string.
Concrete Value Members
- def additionalScript(repository: RepositoryInfo)(implicit context: Context): String
If this suggestion provider needs some additional process to assemble the proposal list (e.g.
If this suggestion provider needs some additional process to assemble the proposal list (e.g. It need to use Ajax to get a proposal list from the server), then override this method and return any JavaScript code.
- def options(repository: RepositoryInfo): Seq[(String, String)]
If this suggestion provider has static proposal list, override this method to return it.
If this suggestion provider has static proposal list, override this method to return it.
If your proposals have label and value, use this method instead of
values()
. The first element of tuple is used as a value, and the second element is used as a label.The returned sequence is rendered as follows:
[ { "label" -> "label1", "value" -> "value1" }, { "label" -> "label2", "value" -> "value2" }, ]
Each element can be accessed as
option
intemplate()
orreplace()
method. - def replace(implicit context: Context): String
JavaScript fragment to generate a replaced value of completion proposal.
JavaScript fragment to generate a replaced value of completion proposal. The default is:
option.value
- val suffix: String
The suffix of the replaced string.
The suffix of the replaced string. The default is
" "
. - def template(implicit context: Context): String
JavaScript fragment to generate a label of completion proposal.
JavaScript fragment to generate a label of completion proposal. The default is:
option.label
. - def values(repository: RepositoryInfo): Seq[String]
If this suggestion provider has static proposal list, override this method to return it.
If this suggestion provider has static proposal list, override this method to return it.
The returned sequence is rendered as follows:
[ { "label" -> "value1", "value" -> "value1" }, { "label" -> "value2", "value" -> "value2" }, ]
Each element can be accessed as
option
intemplate()
orreplace()
method.