Content assist - how to use CA dependent on a previous assignment [message #1059328] |
Fri, 17 May 2013 14:12 |
|
Hello everyone,
I have two questions for you guys.
1. How can I use the CA(content assistant) to be dependent on a previous variable
example:
rule: keyword "id" "text"
For "id" I already have a CA with some suggestions, lets say that they are: "id", "id2"
Now I want for the "text" based on id field to be different. So if I have "id" the CA should show: "text", "text1" and when I have "id2" I will like to have "red" "blue"
Is this possible?
2.If I have a rule X that I'm using it in two places, can I make the CA customizable based on the place where it is used?
example:
rule Y
x= rule X
rule Z
x= rule X
Now I want when I'm using the X in the editor under Z the CA to show me some suggestions "have a nice day", "thanks"
and when I use X under Y to show me "it's summer in Germany"
How can I do that?
Thanks in advance!
Edwin W.T.
Edwin W.T.
|
|
|
|
Re: Content assist - how to use CA dependent on a previous assignment [message #1059343 is a reply to message #1059339] |
Fri, 17 May 2013 15:15 |
|
For answer #1 I didn't get what you mean ...currently I'm override the proposal methods in {myLang}ProposalProvider. There I have a context, but doesn't have an ID for all the objects. I saw something that I can retrieve the rootmodel ...is this the right way to go?
And #2 I don't want completions for x in
RuleY: x=RuleX;
RuleZ: x=RuleX;
I want completion for RuleX.
Book:
'book' name=ID
(book=Name)
;
Car:
'car' name=ID
(car=Name)
;
Name:
'name' name=STRING
;
so now if I'm doing something in completeBook_Name or completeCar_Name the auto completion will work on the 'book' or 'car', but I want the auto completion to work on 'name' from Name
Example:
'car' audi
'name' red (suggestions: red|blue)
and
'book' FunwithXtext
'name' Fun (suggestions: fun|funfun)
Hope now is clear and thanks for the quick answer!
Edwin W.T.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03887 seconds