Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Question about content assist
Question about content assist [message #1690499] Fri, 27 March 2015 16:08
Luis De Bello is currently offline Luis De BelloFriend
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
Previous Topic:Leading whitespaces in template
Next Topic:Using a custom Xbase-compiler
Goto Forum:
  


Current Time: Fri Apr 26 12:36:33 GMT 2024

Powered by FUDForum. Page generated in 0.02702 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top