Question about content assist [message #1690499] |
Fri, 27 March 2015 16:08 |
Luis De Bello Messages: 95 Registered: January 2015 |
Member |
|
|
Hi guys,
I am trying to improve the content assist support and I have one issue in the following case
Case 1 working:
data: {
names: [{name:"John"}] map {
name: $.[@This is the cursor position]
}
}
In this case when I press ctrl + space I have some logic to suggest the fields enclosed in the array before the map, I am doing this using the current model and the contextcontentassist.
However when I am trying to do the same using another way to write my map function
Case 2 not working:
data: {
names: [{name:"John"}] map ((param1, param2) -> {
name: $.[@This is the cursor position]
})
}
I am receiving a different model so the previous logic does not work.
I was debugging this and I am getting different follow elements so the context are different.
I fixed this doing my grammar more relax
Before
$. --> Was not valid
$. --> Is valid so I am getting the same model in both cases.
I wanted to ask you if you have some opinion or best practice in these kind of cases, because I read that xtext recommend to relax the grammar and add more validations but in my cases it seems a work-around instead of a good solution.
Maybe someone have some idea or advice if I should modify the logic for getting follow elements or add more cases or change my grammar.
Thanks in advance
Regards,
Luis
|
|
|
Powered by
FUDForum. Page generated in 0.02702 seconds