问题
I want to add cascading content assist while creating an array of pre-defined values. When I'm creating the array, it should first give me the assist to add only '{'. After that it should suggest me the list of pre-defined values and a '}'. If I choose a value, it should suggest me to add a comma, then repeat the above step. It should keep suggesting me these until I add a closing brace.
Currently I'm able to provide content-assist for only one element in the array.
An example of desired behaviour
// defining the allowed values of array
Attribute list_of_codes {
codes: ["A", "B", "C", "D"]
}
// Using the above values
array {
elements: *Hits C-space to get '{' in content-assist box*
elements: { *Hits C-space to get "A", "B", "C", "D", "}" in content-assist box*
elements: { "A" *Hits C-space to get ',' and '}' in content-assist box*
}
// and so on.
In the end I should get an array that looks like:
array {
elements: {"A", "C", "D"}
}
How do I achieve this behaviour?
来源:https://stackoverflow.com/questions/56054097/how-to-add-cascading-content-assist-in-xtext-document